So as suggest in another thread (Arquillian ShrinkWrap have switched to managed container (Jboss AS 7.1) , now the error is different
New dependency managment (see previous link to original question to see )
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-bom</artifactId>
<version>2.1.2</version>
<scope>test</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.5.Final</version>
<scope>test</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
Then I have to add
<dependency>
<groupId>org.jboss.arquillian.core</groupId>
<artifactId>arquillian-core-api</artifactId>
<version>1.1.4.Final</version>
<scope>test</scope>
</dependency>
Because i have an Exception
Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/core/api/threading/ExecutorService
And now the deploy on local instance of Jboss seems to work fine ( i will test with a simpler test as soon as i have a little time but i think all is fine) Essentially the problem is to add a jar dependencies present in maven (mistral-be which is not part of this maven project) to the deployed test (see description 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)
.loadPomFromFile(str).importBuildOutput().as(JavaArchive.class);
/* https://github.com/shrinkwrap/resolver/blob/master/README.asciidoc#resolution-of-artifacts-defined-in-pom-files */
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]);
}
pomFiles.as(ZipExporter.class).exportTo(new File ("C:\\temp\\res.zip"));
It generate quite a big zip file only to check the result, but while try'n to deploy to jboss 7.1.1
18:46:17,003 INFO [org.jboss.as.repository] (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 [org.jboss.as.server.deployment] (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 see in the app server log it is
Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes.
I see in the META_INF of the zipped file directory a lot o files coming from transitive dependencies of mistral-be, so the problem could be this. Is there anyway to generate a JAR file with a valid signature? Or may be i am using a wrong aprroach to solve this problem (contruct jar in another way or similar idea)? And i'm curios why the dependencies in pom:
<dependency>
<groupId>it.**.mistral</groupId>
<artifactId>mistral-be</artifactId>
<version>0.1.0</version>
<scope>compile</scope>
</dependency>
is not directly import by this instruction? Did i miss something?
String str = "C:\\IntellijProject\\Import***\\import****\\migrazione****-be\\pom.xml";
JavaArchive pomFiles = ShrinkWrap.create(MavenImporter.class)
.loadPomFromFile(str).importBuildOutput().as(JavaArchive.class);
Thank you