Arquillian ShrinkWrap maven dependencies in pom

Since the proposal is on a different thread ( Arquillian ShrinkWrap switched to a managed container (Jboss AS 7.1), now the error is different

New dependency management (see previous link to original question)



Then I must add



Because I have Exception

Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/core/api/threading/ExecutorService


And now deploying to a local Jboss instance is working fine (I will test with a simpler test as soon as I have little time, but I think everything is fine) Essentially the problem is adding the jar dependencies present in maven (mistral- be which is not part of this maven project) to the deployed test (see the description of this question ( Arquillian ShrinkWrap )). Finally i use this code

String str = "C:\\IntellijProject\\Import***\\import****\\migrazione****-be\\pom.xml";
    JavaArchive pomFiles = ShrinkWrap.create(MavenImporter.class)

/* */
JavaArchive[] mistral_be = Maven.configureResolver().workOffline().resolve("it.****.mistral:mistral-be:0.1.0").withTransitivity().as(JavaArchive.class);

for (int i = 0; i < mistral_be.length ; i++) {
        pomFiles = pomFiles.merge(mistral_be[i]);


} File ("C:\\temp\\"));


It generates a rather large zip file just to test the result, but for now try'n to deploy to jboss 7.1.1

18:46:17,003 INFO  [] (management-handler-thread - 2) JBAS014900: Content added at location C:\jboss\jboss-as-7.1.1.Final\standalone\data\content\bc\b6fd502db2696342419c17a6d2ed82a4176a4e\content
18:46:17,008 INFO  [] (MSC service thread 1-8) JBAS015876: Starting deployment of "arquillian-service"


I have an error:

org.jboss.arquillian.container.spi.client.container.DeploymentException: Could not deploy to container: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"postImportBE-1.0-SNAPSHOT.jar\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"postImportBE-1.0-SNAPSHOT.jar\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"postImportBE-1.0-SNAPSHOT.jar\""}}


As I can see in the application server log it is

Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes.


I see many files in META_INF of zipped files directory coming from mistral-be transitive dependencies, so the problem might be like this. Is there a way to generate a JAR file with a valid signature? Or maybe I am using the wrong aprroach to solve this problem (contruct jar in a different way or a similar idea)? And I'm curious why the dependencies in the pom are:



not directly imported by this instruction? Did I miss something?

String str = "C:\\IntellijProject\\Import***\\import****\\migrazione****-be\\pom.xml";
    JavaArchive pomFiles = ShrinkWrap.create(MavenImporter.class)




source to share

1 answer

When working with pom dependencies, I use WebArchive instead of JavaArchive to package all the required code generated by ShrinkWrap:

String[] mavenLibs = {

WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
for (String dependency : mavenLibs) {


Using this mecanism, I didn't have the problem you described.



All Articles