【发布时间】:2012-04-08 11:50:42
【问题描述】:
我正在打包一个 ejb,我需要将一些依赖项中的 .classes 包含到 jar 中,我正在尝试使用 maven-dependency-plugin 来解压工件并将在 package 阶段我的 ${project.build.directory}/classes 目录中的文件,但是当我执行 mvn package 我没有看到任何记录或引用 maven-dependency-plugin(没有任何反应),我什至尝试放置无效版本的插件,它甚至不会抛出异常。
在我的 pom.xml 下
....
<packaging>ejb</packaging>
<name>myapp</name>
...repository and props
<build>
<pluginManagement>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.myapp</groupId>
<artifactId>model</artifactId>
<version>1.0.0</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<includes>**/shared/*.class</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.myapp</groupId>
<artifactId>model</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
我错过了什么?
PS:工件模型安装在本地仓库中,我也尝试过其他阶段。
【问题讨论】:
标签: maven maven-3 maven-dependency-plugin