使用netbeans.deploy时Netbeans取消部署

时间:2015-07-28 07:20:33

标签: java maven tomcat netbeans

我使用下面的xml创建了一个自定义netbeans操作。

<action>
    <actionName>CUSTOM-mvn redeploy</actionName>
    <displayName>mvn redeploy</displayName>
    <properties>
        <netbeans.deploy>true</netbeans.deploy>
        <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>
    </properties>
    <goals>
        <goal>compile</goal>
        <goal>war:exploded</goal>
        <goal>tomcat7:redeploy</goal>
    </goals>
</action>

问题是当使用netbeans.deploy元素时取消使用war。

tomcatManager status code:200, ReasonPhrase:OK
OK - Deployed application at context path /myservice
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 25.510 s
Finished at: 2015-07-28T14:51:21+08:00
Final Memory: 37M/367M
------------------------------------------------------------------------
NetBeans: Deploying on Apache Tomcat or TomEE
    profile mode: false
    debug mode: true
    force redeploy: true
<b>Undeploying ...
undeploy?path=/myservice
OK - Undeployed application at context path /myservice

2 个答案:

答案 0 :(得分:3)

对于任何可能需要此功能的人。不知怎的,我通过在你的pom.xml中添加一个配置文件来解决这个问题。您添加的配置文件将成为配置。将自定义操作添加到该配置

<profiles>
    <profile>
    <id>dev</id>
    <build>
        <finalName>myservice</finalName>
    </build>
</profile>

答案 1 :(得分:0)

不确定作者使用的是哪个版本的 Netbeans,但从 Netbeans 12.2 开始,请参阅:https://issues.apache.org/jira/browse/NETBEANS-5143