我试图使集中的项目来管理修订。我有多模块项目。
我使用apache扁平化我的参考链接:
https://blog.soebes.de/blog/2017/04/02/maven-pom-files-without-a-version-in-it/ https://dev.to/khmarbaise/continuous-delivery-with-apache-maven--4i03 https://maven.apache.org/maven-ci-friendly.html
当我试图为子项目运行maven目标时
-Drevision=3.0.0 clean install我明白这个例外
Downloading from archiva.internal: http://localhost:8080/repository/internal/io/geniusbrain/great/$%7Brevision%7D/great-$%7Brevision%7D.pom它无法解决${revision}。,但是当我尝试父项目时,它是有效的。但是我不得不去参加子项目,因为我在里面使用了spring。所以我为它使用了spring:repackage,。
我试图将maven版本从3.5.4更改为3.6.0,我也尝试过这样做
我的父母就像这样
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.geniusbrain</groupId>
<artifactId>great</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<name>great</name>
<module>firstmodule</module>
<module>x1</module>
<module>x2</module>
<module>x3</module>
<!--- etc -->
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<pg-commons-util.version>1.0</pg-commons-util.version>
<pg-commons-rabbit.version>1.3.4</pg-commons-rabbit.version>
<ignite.version>2.7.5</ignite.version>
<spring.boot.version>2.1.2.RELEASE</spring.boot.version>
<spring.cloud.config.version>2.1.2.RELEASE</spring.cloud.config.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<configuration>
<updatePomFile>true</updatePomFile>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<distributionManagement>
<repository>
<id>archiva.internal</id>
<name>Internal Release Repository</name>
<url>http://127.0.0.1:8080/repository/internal/</url>
</repository>
<snapshotRepository>
<id>archiva.snapshots</id>
<name>Internal Snapshot Repository</name>
<url>http://127.0.0.1:8080/repository/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>archiva.internal</id>
<url>http://127.0.0.1:8080/repository/internal/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>archiva.snapshots</id>
<url>http://127.0.0.1:8080/repository/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<!--- etc -->
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lib-cluster-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-dependencies</artifactId>
<version>${spring.cloud.config.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!--- etc -->
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>我的孩子就像这样
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.geniusbrain</groupId>
<artifactId>great</artifactId>
<version>${revision}</version>
</parent>
<name>firstmodule</name>
<artifactId>firstmodule</artifactId>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<!--- etc -->
</dependencies>
</project>发布于 2019-08-13 11:29:42
这是我找到的解决办法
我为每个子项目添加了这个配置。
<build>
<plugins>
<!--My others plugins for ex : spring-boot -->
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
flatten-maven-plugin
</artifactId>
<versionRange>
[1.1.0,)
</versionRange>
<goals>
<goal>flatten</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>https://stackoverflow.com/questions/57468201
复制相似问题