maven - 如何从war文件中删除版本号

标签 maven pom.xml maven-war-plugin maven-ear-plugin

我对像这样的子pom有依赖性。

<dependencies>
        <dependency>
            <groupId>sample-groupID</groupId>
            <artifactId>sfint</artifactId>
            <version>1.0.0-SNAPSHOT</version>  
            <type>war</type>                
        </dependency>
</dependencies>

我正在使用maven-ear-plugin。
 <plugins>
  <plugin>
   <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven.ear.plugin</artifactId>
    <version>2.10</version>
    <configuration>
            <modules>
                <webModule>
                    <groupId>sample-gropuID</groupId>
                    <artifactId>sfint</artifactId>
                    <version>1.0.0-SNAPSHOT</version>
                    <moduleID>WebModule_sfint</moduleID>
                    <bundleFileName>sfint.war</bundleFileName>  
                </webModule>
            </modules>  
    </configuration>
  </plugin>

现在我的问题是我希望我的war文件是这样的- sfint.war ,但我将其获取为- sfint.1.0.0-SNAPSHOT.war

有帮助吗??

最佳答案

<build>标记内,将 Artifact 所需的名称指定为“finalName”。

<build>
    <finalName>sfint</finalName>
</build>

关于maven - 如何从war文件中删除版本号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33411621/

相关文章:

java - 如何创建多模块 Spring Boot Maven 项目?

maven - 部署到 Maven 存储库时, "resolver"是什么?

git - 我怎样才能在 Maven 中执行 git pull?

java - Resin 的 `pomegranate' - 自动神奇加载项目的 Maven jar 依赖项 - 但如何使用 pom.xml 为它们生成 jar?

maven - 如果使用某个配置文件,让 Maven 失败并显示消息

eclipse - 如何找到正确的 Maven 原型(prototype)项目以便在 Eclipse 中使用 Scala 进行开发?

java - Maven deps 在 POM 中找不到版本字段

google-app-engine - Appengine Maven 插件 - 端点目标 - 启用对 .discovery 文件的过滤

java - 访问位于 WEB-INF 文件夹中的资源

Maven war插件复制任意文件