我将springboot从2.1.4.RELEASE升级到2.3.3.RELEASE更新了一些其他依赖项。POM如下:
<?xml version="1.0" encoding="UTF-8"?>4.0.0 com.gn gservices 1.0.0-快照jar
<name>AbcXZ</name>
<description>AbcXZ Services</description>
<!--
<repositories>
<repository>
<id>groovy</id>
<name>repo for groovy</name>
<url>https://dl.bintray.com/groovy/maven/</url>
</repository>
</repositories> -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version>
<relativePath />
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>14</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>4.3.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-firestore</artifactId>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-52</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>6.0.0-beta</version>
</dependency>
<dependency>
<groupId>com.twilio.sdk</groupId>
<artifactId>twilio</artifactId>
<version>7.36.0</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20200518</version>
</dependency>
<dependency>
<groupId>org.mnode.ical4j</groupId>
<artifactId>ical4j</artifactId>
<version>3.0.14</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>install-common-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>common</classifier>
<includes>
<include>**/common/**/*.class</include>
</includes>
<finalName>abcxz</finalName>
</configuration>
</execution>
<execution>
<id>create-data-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>data</classifier>
<includes>
<include>**/entity/**/*.class</include>
<include>**/repositories/**/*.class</include>
<include>**/repository/**/*.class</include>
</includes>
<finalName>abcxz</finalName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<id>install-common-jar</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>install</phase>
<configuration>
<groupId>com.abcxz</groupId>
<artifactId>abcxz-common</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<file>${basedir}/target/abcxz-common.jar</file>
<generatePom>false</generatePom>
</configuration>
</execution>
<execution>
<id>install-data-jar</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>install</phase>
<configuration>
<groupId>com.abcxz</groupId>
<artifactId>abcxz-data</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<file>${basedir}/target/abcxz-data.jar</file>
<generatePom>false</generatePom>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>14</release>
<compilerArgs>
<arg>--enable-preview</arg>
</compilerArgs>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<parameters>true</parameters>
</configuration>
</plugin>
</plugins>
</build>在此升级之后。当我运行dependency:go-offline时,它失败了,错误如下:
无法在项目gservices上执行目标org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline (默认-cli):org.eclipse.aether.resolution.DependencyResolutionException:在中心(https://repo.maven.apache.org/maven2)中找不到项目org.codehaus.groovy:groovy-org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline:jar:2.5.4
我尝试添加https://dl.bintray.com/groovy/maven/作为额外的存储库,但没有帮助。根据maven文档中的依赖关系:go-offline:
“此目标与调用mvn dependency:resolve dependency:resolve-plugins完全相同。”
但是当我运行mvn dependency:resolve和mvn dependency:resolve-plugins时,它是成功的。我花了很多时间试图弄清楚这一点。如果任何人有想法,请分享。
谢谢,
发布于 2021-02-06 00:16:30
在将spring-boot-starter-parent从2.2.4升级到2.3.8时,我遇到了完全相同的问题。在我的例子中,它包含了这个jar:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.2.RELEASE</version>
<scope>test</scope>
</dependency>我的修复相对简单,因为我可以删除这个jar,因为它实际上并没有在项目中使用。从快速查看您的依赖项来看,似乎这个jar:
<dependency>
<groupId>org.mnode.ical4j</groupId>
<artifactId>ical4j</artifactId>
<version>3.0.14</version>
</dependency>导入org.codehaus.groovy jar,这可能是导致问题的原因。
https://stackoverflow.com/questions/63852989
复制相似问题