【发布时间】:2011-05-15 00:53:09
【问题描述】:
目前我正在尝试为基于axis2的项目制作maven构建任务。
在我的pom.xml 中,我定义了依赖 jar 文件。我希望当战争开始时,jar 将被移动到另一个目录:不是在war/web-inf/lib,而是war/web-inf/servicejars
我查看了有关 stackoverflow 的类似问题,但没有帮助。
<dependencies>
<dependency>
<groupId>mycompany</groupId>
<artifactId>MyService</artifactId>
<!-- didnt work for me -->
<!--<properties>-->
<!--<war.target.path>servicejars</war.target.path>-->
<!--</properties>-->
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>1.5.2</version>
</dependency>
<!-- etc ... -->
</dependencies>
<build>
<finalName>Axis2</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
</configuration>
<extensions>true</extensions>
</plugin>
<!--<plugin> Didn't worked too-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-dependency-plugin</artifactId>-->
<!--<version>2.1</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>copydep</id>-->
<!--<phase>prepare-package</phase>-->
<!--<goals>-->
<!--<goal>copy-dependencies</goal>-->
<!--</goals>-->
<!--<inherited>false</inherited>-->
<!--<configuration>-->
<!--<includeArtifactIds>MyService</includeArtifactIds>-->
<!--<outputDirectory>$project.build.directory/${project.build.finalName}/web-inf/servicejars</outputDirectory>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
</plugins>
</build>
提前致谢。
【问题讨论】:
-
i want that when war is building, the jar will be moved to another directory: not in war/web-inf/lib but to war/web-inf/servicejars这是有原因的吗?为什么不让 maven 处理依赖关系? -
实际上我需要将其部署为axis2服务。如果它可以通过一些插件来完成 - 那就更好了。
标签: web-services maven-2 maven axis2