开发者

maven-ear-plugin ignores unpack option for modules

I have an Java EE 6 EAR-project with a couple of modules (jars & ejb). Assembling the EAR-file with the maven-ear-plugin, I basically want all artifacts to be packed / unexploded:

from the pom.xml of the parent file:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-ear-plugin</artifactId>
  <version>2.5</version>
  <inherited>true</inherited>
  <configuration>
    <encoding>UTF-8</encoding>
    <version>5</version>
    <generateApplicationXml>true</generateApplicationXml>
    <defaultLibBundleDir>lib</defaultLibBundleDir>
    <archive>
      <manifestEntries>
        <app-version-info>${app-version-info}</app-version-info>
      </manifestEntries>
    </archive>
  </configuration>
</plugin>

from the pom.xml of the ear file:

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <finalName>heap-poc</finalName>
          <modules>
            <jarModule>
              <groupId>com.example.heap</groupId>
              <artifactId>poc-common</artifactId>
              <bundleFileName>poc-common.jar</bundleFileName>
              <unpack>true</unpack>
              <includeInApplicationXml>true</includeInApplicationXml> 
            </jarModule>
            <jarModule>
              <groupId>com.example.heap<开发者_开发问答;/groupId>
              <artifactId>poc-persistence</artifactId>
              <bundleFileName>poc-persistence.jar</bundleFileName>
              <includeInApplicationXml>true</includeInApplicationXml> 
            </jarModule>
            <ejbModule>
              <groupId>com.example.heap</groupId>
              <artifactId>poc-business</artifactId>
              <unpack>false</unpack>
              <bundleFileName>poc-business.jar</bundleFileName>
            </ejbModule>
          </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>

The problem is that the described unpack-switch seems to be completely ignored:

  • poc-common.jar (unpack=true) is packed
  • poc-persistence.jar (no unpack defined) is packed
  • poc-business.jar (unpack=false) is exploded

I'm working with Eclipse Helios / m2eclipse, but from my understanding this shouldn't matter much for the problem.

Can someone push me in the right direction?


I was wrong with my assumption that Eclipse is not responsible for the problem. As a matter of fact, maven from the command line does what it's supposed to do, it's "just" the rather complex integration of m2-eclipse and jboss-tools which seems to ignore the settings in question.

mvn package does exactly do what it's supposed to do :-)

A whole week of migrating an ant-based Java EE 5 project to maven and Java EE 6 taught me the hard way that Maven on JBoss in Eclipse is a whole lot different than Maven on the command line...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜