简体   繁体   English

buildnumber-maven-plugin属性$ {buildNumber}的可见性

[英]Visibility of buildnumber-maven-plugin property ${buildNumber}

I am trying to use buildnumber-maven-plugin to append the SCM build number to the WAR artifact name and then use tomcat7-maven-plugin to deploy it but in a context path that doesn't include the build number. 我试图使用buildnumber-maven-plugin将SCM内部版本号附加到WAR工件名称,然后使用tomcat7-maven-plugin进行部署,但是要在不包含内部版本号的上下文路径中进行部署。 So I am making foo-r1234.war where foo is my project and 1234 is the revision number in Subversion but I want to deploy it in a Tomcat context foo . 所以我正在制作foo-r1234.war ,其中foo是我的项目,而1234是Subversion中的修订号,但是我想将其部署在Tomcat上下文foo中

I got the war generation to reflect the build number but the problem is that the Tomcat plugin doesn't see the ${buildNumber} property assigned by the buildnumber plugin: 我得到了反映生成版本号的信息,但是问题是Tomcat插件没有看到由buildnumber插件分配的${buildNumber}属性:

<finalName>foo-r${buildNumber}</finalName>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
    <executions>
        <execution>
            <id>create-buildno</id>
            <phase>validate</phase>
            <goals>
                <goal>create</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <doCheck>false</doCheck>
        <doUpdate>false</doUpdate>
    </configuration>
</plugin>
...
<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <configuration>
        <url>http://localhost:8080/manager/text</url>
        <path>/foo</path>
    <warFile>${project.build.directory}/${project.build.finalName}.war</warFile>
    </configuration>
</plugin>

I get 我懂了

[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project foo: Cannot find war file: /my/path/target/foo-r${buildNumber}.war -> [Help 1] [ERROR] [错误]无法在项目foo上执行目标org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy(default-cli):无法找到War文件:/ my / path / target / foo-r $ { buildNumber} .war-> [帮助1] [错误]

Which indicates the tomcat plugin doesn't see ${buildNumber}. 这表示tomcat插件没有看到$ {buildNumber}。 How can I make it visible in order to deploy foo-r${buildNumber}.war to a context foo in Tomcat? 我如何使其可见以便将foo-r $ {buildNumber} .war部署到Tomcat中的上下文foo?

RELATED: 有关:

How to deploy war with automatic buildnumber to tomcat using maven tomcat plugin 如何使用Maven tomcat插件将带有自动内部编号的战争部署到tomcat

timestamp and buildNumber properties not set during deploy goal 部署目标期间未设置timestamp和buildNumber属性

在配置/${project.build.finalName}中添加构建最终名称

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM