9

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?

James R. Perkins
  • 16,800
  • 44
  • 60
drone.ah
  • 1,135
  • 14
  • 28

2 Answers2

3

A similar issue was reported during 'maven install' [1]

The following solution was offered :- directly mention dependencies.

Use:
.addAsManifestResource("Dependencies: org.infinispan.infinispan-tree, org.infinispan","MANIFEST.MF");

Instead of: .addAsManifestResource("META-INF/MANIFEST.MF", "MANIFEST.MF");

[1] https://issues.jboss.org/browse/ARQ-679

Mitesh Pathak
  • 1,306
  • 10
  • 14
  • Thank you. However, this unfortunately didn't work. It throws an error that the "Dependencies: ..." cannot be found. Looking at the [JavaArchive API](http://docs.jboss.org/shrinkwrap/1.0.0-alpha-9/org/jboss/shrinkwrap/api/spec/JavaArchive.html), there is no method for describing contents instead of filename. Additionally, the issue you refer to talks about the test failing *only* on mvn install. It doesn't work for me even when just running the test. I wonder if the possibility of using this method was remove post version 1.0.0.CR6 – drone.ah Dec 17 '13 at 11:50
1

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>
drone.ah
  • 1,135
  • 14
  • 28