当我执行maven发行版时:使用构建版本meaning:artifactId.version执行生成的文件名。我需要至少在执行时生成的war名称仅为artifactId名称。
my pom is here:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.tingz</groupId>
<artifactId>dashboard</artifactId>
<packaging>war</packaging>
<version>15-SNAPSHOT</version>
<name>dashboard Maven Webapp</name>
<url>http://maven.apache.org</url>
<distributionManagement>
<repository>
<id>google</id>
<url>file:/home/ziv/Documents/dashboard/versions/</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<build>
<finalName>dashboard</finalName>
<plugins>
<!-- Release plugin Test!!!! -->
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<tagBase>
file:/home/ziv/tag
</tagBase>
<checkModificationExcludes>
<checkModificationExclude>pom.xml</checkModificationExclude>
</checkModificationExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.4</version>
<configuration>
<username>zivziv</username>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<scm>
<connection>xxx</connection>
<developerConnection>xxxd</developerConnection>
<tag>dashboard-11</tag>
</scm>
</project>发布于 2015-12-16 15:18:38
Maven发布插件不会“生成”任何文件。Maven构建生命周期中涉及到的其他插件(例如jar插件)确实生成文件。因此,设置"finalName“就像您所做的那样,只要涉及到”生成“,就应该做到这一点。
发布插件所做的就是
后者总是需要一个Maven GAV,而V是用于版本的。否则,发布将不是唯一的。因此,如果您希望发布插件将工件部署到没有版本的存储库中,那么您将失败。从定义上来说,这是不可能的。
你应该考虑不要使用发布插件-毕竟,它是一个糟糕的插件。参见例如https://axelfontaine.com/blog/final-nail.html
考虑使用旅行车-maven-插件来实现您的目标:http://www.mojohaus.org/wagon-maven-plugin/。
https://stackoverflow.com/questions/34311105
复制相似问题