[JBoss JIRA] (SHRINKRES-150) Wrong built WebArchive using Shrinkwrap Classpath resolution
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-150?page=com.atlassian.jira.plu... ]
Matous Jobanek updated SHRINKRES-150:
-------------------------------------
Fix Version/s: (was: 3.0.0)
> Wrong built WebArchive using Shrinkwrap Classpath resolution
> ------------------------------------------------------------
>
> Key: SHRINKRES-150
> URL: https://issues.jboss.org/browse/SHRINKRES-150
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Affects Versions: 2.0.0
> Environment: win 7 (64 bit), glassfish 3.1.2
> Reporter: Gunther Klein
>
> Hi,
> I have defined a simple war project and setup an arquillian test using shrinkwrap 2.0.0, that - as a test - just resolves the web archive via classpath resolution:
> {code:borderStyle=solid}
> @RunWith(Arquillian.class)
> public class ShrinkwrapTestIT {
> @Deployment
> public static Archive<?> createDeployment() {
> WebArchive war = Maven.resolver()
> .resolve("shrinkwrap.test:shrinkwrap.test:war:0.0.1-SNAPSHOT").withClassPathResolution(true)
> .withoutTransitivity().asSingle(WebArchive.class);
> System.out.println(war.toString(true));
> return war;
> }
> @Test
> public void test() {
> //do nothing
> }
> }
> {code}
> The output shows, that the archive is incomplete (resource files are missing) and not even war conform:
> some_text_file.txt
> com/
> com/test/
> com/test/Test.class
> If i change the code to use .withClassPathResolution(false), the output is:
> /some_text_file.txt
> /index.jsp
> /com/
> /com/test/
> /com/test/Test.class
> /WEB-INF/
> /WEB-INF/web.xml
> /WEB-INF/sun-web.xml
> /META-INF/
> /META-INF/MANIFEST.MF
>
> Now the resources are included, but the class(es) are packaged at the top level and not under /WEB-INF/classes, so it still doesnt respresent a valid war. My pom looks like:
> {code:xml}
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>shrinkwrap.test</groupId>
> <artifactId>shrinkwrap.test</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <packaging>war</packaging>
> <properties>
> <project.build.sourceEncoding>ISO8859-1</project.build.sourceEncoding>
> <version.shrinkwrap.resolvers>2.0.0</version.shrinkwrap.resolvers>
> </properties>
> <dependencies>
> <!-- test dependencies -->
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.11</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.junit</groupId>
> <artifactId>arquillian-junit-container</artifactId>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.container</groupId>
> <artifactId>arquillian-glassfish-remote-3.1</artifactId>
> <version>1.0.0.CR4</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.shrinkwrap.resolver</groupId>
> <artifactId>shrinkwrap-resolver-depchain</artifactId>
> <version>${version.shrinkwrap.resolvers}</version>
> <scope>test</scope>
> <type>pom</type>
> </dependency>
> </dependencies>
> <dependencyManagement>
> <dependencies>
> <!-- Override dependency resolver with latest version. This must go *BEFORE*
> the Arquillian BOM. -->
> <dependency>
> <groupId>org.jboss.shrinkwrap.resolver</groupId>
> <artifactId>shrinkwrap-resolver-bom</artifactId>
> <version>${version.shrinkwrap.resolvers}</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian</groupId>
> <artifactId>arquillian-bom</artifactId>
> <version>1.1.1.Final</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> </dependencies>
> </dependencyManagement>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-failsafe-plugin</artifactId>
> <version>2.16</version>
> <configuration>
> <skipTests>${skipITs}</skipTests>
> </configuration>
> <executions>
> <execution>
> <goals>
> <goal>integration-test</goal>
> <goal>verify</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> </project>
> {code}
> Why is shrinkwrap giving me corrupt archives here in both cases? For the case with classpath resolution i would expect shrinkwrap to give me the war, that was built by maven in the package phase? Without classpath resolution i would expect shrinkwrap to resolve the war from maven respository (local or remote). Or is my understanding of shrinkwrap (classpath) resolution wrong here?
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 6 months
[JBoss JIRA] (SHRINKRES-180) transitive dependencies updated from provided to compile
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-180?page=com.atlassian.jira.plu... ]
Matous Jobanek updated SHRINKRES-180:
-------------------------------------
Fix Version/s: (was: 3.0.0)
> transitive dependencies updated from provided to compile
> --------------------------------------------------------
>
> Key: SHRINKRES-180
> URL: https://issues.jboss.org/browse/SHRINKRES-180
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Affects Versions: 2.2.0-alpha-2
> Reporter: Markus Schulz
> Attachments: MavenResolverTest.java, deptree.txt, transitivetest-pom.xml
>
>
> i have a pom with something like:
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-search</artifactId>
> <version>4.2.0.Final</version>
> </dependency>
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-core</artifactId>
> <scope>provided</scope>
> </dependency>
> hibernate-search internally dependes on hibernate-core (scope compile). But in don't want to get hbernate-core in my deployment, therefore it's forced to provided.
> But:
> File[] testLibs = Maven.configureResolver()
> .workOffline()
> .loadPomFromClassLoaderResource("transitivetest-pom.xml")
> .importRuntimeDependencies()
> .resolve()
> .withTransitivity()
> .asFile();
> still contains hibernate-core.jar
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 6 months
[JBoss JIRA] (SHRINKRES-184) Shrinkwrap maven local repo resolution not working since ARQ 1.1.4.Final
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-184?page=com.atlassian.jira.plu... ]
Matous Jobanek updated SHRINKRES-184:
-------------------------------------
Fix Version/s: (was: 3.0.0)
> Shrinkwrap maven local repo resolution not working since ARQ 1.1.4.Final
> ------------------------------------------------------------------------
>
> Key: SHRINKRES-184
> URL: https://issues.jboss.org/browse/SHRINKRES-184
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Environment: Maven 3.2.1
> Java 7 64 - bit
> Windows 7 64 bit
> Reporter: Sueleyman Vurucu
>
> I update ARQ from 1.1.3.Final to 1.1.4.Final.
> After I try to excecute my testsuite I had a Exception that some of the artifacts could not be resolved. After Debugging I see that shrinkwrap looks for that artifacts on our local nexus server. Unfortunately we dont deploy our development artifact on nexus.
> The MavenResolverSystem is configured like shown below:
> // ARQ 1.1.3.Final
> private static MavenResolverSystem getMavenDependencyResolver() {
> MavenResolverSystem mavenResolverSystem = Maven.configureResolver().fromFile(pathToSettingsXML);
> mavenResolverSystem.offline();
> return mavenResolverSystem;
> }
> // ARQ 1.1.4.Final
> private static ConfigurableMavenResolverSystem getMavenDependencyResolver() {
> ConfigurableMavenResolverSystem mavenResolverSystem = Resolvers.configure(ConfigurableMavenResolverSystem.class);
> mavenResolverSystem.withClassPathResolution(true);
> mavenResolverSystem.fromFile(pathToSettingsXML);
> mavenResolverSystem.workOffline();
> return mavenResolverSystem;
> }
> As you can see I say to MavenResolverSystem that it should work offline.
> After deep debugging I see that the resolversystem try to find all the artifacts on our nexus.
> //ARQ 1.1.3.Final
> DefaultRepositorySystem:367
> com.siemag.base:wms-base-controller:ejb:3.0.0-SNAPSHOT <(compile)
> //ARQ 1.1.4.Final
> In the class DefaultRepositorySystem:367
> com.siemag.base:wms-base-controller:ejb:3.0.0-SNAPSHOT < [nexus (http://172.16.55.1:8081/nexus/content/groups/public, releases)]
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 6 months