Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cargo Maven2插件-更改远程类型的目标文件名_Maven_Plugins_Deployment_Cargo - Fatal编程技术网

Cargo Maven2插件-更改远程类型的目标文件名

Cargo Maven2插件-更改远程类型的目标文件名,maven,plugins,deployment,cargo,Maven,Plugins,Deployment,Cargo,我最近开始使用cargo-maven2-plugin org.codehaus.cargo将一个WAR工件部署到远程服务器上,它似乎工作得很好,只有一个例外。一旦目标文件复制到远程服务器,我似乎无法找到一种方法来指定其名称。例如,构建的工件名为my-war-artifact-2013.10.war,但当它部署到服务器时,我希望它部署为my-war-artifact.war 所有状态都可以执行,但仅当使用本地类型时。有没有人做过这件事,或者想出了一个方法来做这件事??我非常需要这种能力!下面是我的

我最近开始使用cargo-maven2-plugin org.codehaus.cargo将一个WAR工件部署到远程服务器上,它似乎工作得很好,只有一个例外。一旦目标文件复制到远程服务器,我似乎无法找到一种方法来指定其名称。例如,构建的工件名为my-war-artifact-2013.10.war,但当它部署到服务器时,我希望它部署为my-war-artifact.war

所有状态都可以执行,但仅当使用本地类型时。有没有人做过这件事,或者想出了一个方法来做这件事??我非常需要这种能力!下面是我的POM的相关部分

<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <executions>
    <execution>
      <id>deploy</id>
      <phase>package</phase>
      <goals>
        <goal>deployer-redeploy</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <container>
      <containerId>tomcat7x</containerId>
      <type>remote</type>
    </container>
    <configuration>
      <type>runtime</type>
      <properties>
        <cargo.remote.username>${tomcat.username}</cargo.remote.username>
        <cargo.remote.password>${tomcat.password}</cargo.remote.password>
        <cargo.tomcat.manager.url>
          http://${host}${port}/manager
        </cargo.tomcat.manager.url>
      </properties>
    </configuration>
  </configuration>
</plugin>

在货物配置中添加:

...
<deployables>
    <deployable>
        <groupId>${project.groupId}</groupId>
        <artifactId>${project.artifactId}</artifactId>
        <type>war</type>
        <properties>
            <context>my-war-artifact</context>
        </properties>
    </deployable>
</deployables>

我目前将其与TomEE结合使用,复制到webapps中的目标文件名是由后缀war添加的上下文标记所包含的名称。

在货物配置中添加:

...
<deployables>
    <deployable>
        <groupId>${project.groupId}</groupId>
        <artifactId>${project.artifactId}</artifactId>
        <type>war</type>
        <properties>
            <context>my-war-artifact</context>
        </properties>
    </deployable>
</deployables>

我目前将其与本书结合使用,复制到webapps中的目标文件名是由后缀war添加的上下文标记所包含的名称。

非常感谢您的回答!肯定对我有用。为了完整起见,我决定放弃cargo2插件,转而支持Jenkins post操作。我决定将构建平台和部署平台分开。非常感谢您的回答!肯定对我有用。为了完整起见,我决定放弃cargo2插件,转而支持Jenkins post操作。我决定将构建平台和部署平台分开。