jboss7.xjboss-arquillianjboss-modules

Dependencies in MANFEST.MF ignored on JBoss 7


We have an EJB module that we are deploying to JBoss 7.1.1 which depends on Infinispan and Infinispan Treecache.

I created a module and deployed it in the modules section of jboss.

However, there seems to be a problem with it getting picked up correctly. This is being run as an Arquillian Test. The deployment is:

@Deployment
public static Archive<?> createDeployment() {
    Archive<?> archive = ShrinkWrap.create(JavaArchive.class)
            .addPackages(true, "<package>")
            .addAsManifestResource("META-INF/MANIFEST.MF", "MANIFEST.MF")
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}

MANIFEST.MF is as follows

Manifest-Version: 1.0
Dependencies: org.infinispan.infinispan-tree, org.infinispan

infinispan-tree is the module that was added to jboss manually.

To test that it was not the module configuration, these two modules were made global in the standalone.xml and lo and behold everything worked fine.

Even changing just the org.infinispan (included with JBoss 7.x) to be non-global and trying to reference that from MANIFEST.MF did not work.

What is missing?


Solution

  • The whole thing turned out to be a lot simpler.

    Even with .addAsManifestResource OR .setManifest, the MANIFEST.MF was autogenerated by Maven.

    This was resolved with the following section in pom.xml instead of using a custom MANIFEST.MF and using .setManifest("META-INF/MANIFEST.MF"); The MANIFEST.MF is auto-generated and there is no customised copy in the resources folder (to avoid confusion more than anything since it was ignored anyway)

    <build>
        <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-jar-plugin</artifactId>
           <configuration>
              <archive>
                 <manifestEntries>
                    <Dependencies>
                    org.infinispan, 
                    org.infinispan.infinispan-tree export,
                    </Dependencies>
                 </manifestEntries>
              </archive>
           </configuration>
         </plugin>
        </plugins>
    </build>