Skip to content

Latest commit

 

History

History
108 lines (83 loc) · 4.76 KB

README.adoc

File metadata and controls

108 lines (83 loc) · 4.76 KB

shrinkwrap-resolver: Demonstrates Usage of Shrinkwrap Resolver

The shrinkwrap-resolver quickstart demonstrates three common use cases for ShrinkWrap Resolver in WildFly Application Server.

What is it?

This quickstart demonstrates the use of ShrinkWrap Resolver in WildFly Application Server.

With the advent of Maven and other build systems, typically third party libraries and our own dependent modules are obtained from a backing software repository. In this case we supply a series of coordinates which uniquely identifies an artifact in the repository, and resolve the target files from there.

That is precisely the aim of the ShrinkWrap Resolver project; it is a Java API to obtain artifacts from a repository system.

The shrinkwrap-resolver quickstart demonstrates various use cases for ShrinkWrap Resolver. This Quickstart has 3 Test Classes that demonstrates the following Shrinkwrap use cases:

  • ShrinkwrapResolveGAVWithoutTransitiveDepsTest

  • Resolves an artifact using G:A:V without transitive dependencies.

  • Returns resolution result as single java.io.File.

  • ShrinkwrapImportFromPomTest

  • Loading a pom.xml from file activating and deactivating profiles.

  • Importing dependencies of specified scope into list of artifacts to be resolved.

  • Return resolution results as a java.io.File array.

  • ShrinkwrapResolveGAPCVCustomRepoWithoutCentralTest

  • Resolve an artifact via G:A:P:C:V without transitive dependencies

  • Resolve an artifact with classifier

  • Disabling Maven Central

  • Loading settings.xml from file (with custom repository)

  • Returns resolution results as a java.io.File array

Investigate the Console Output

When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results.

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.jboss.as.quickstarts.shrinkwrap.resolver.ShrinkwrapImportFromPomTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.633 sec
Running org.jboss.as.quickstarts.shrinkwrap.resolver.ShrinkwrapResolveGAPCVCustomRepoWithoutCentralTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.439 sec
Running org.jboss.as.quickstarts.shrinkwrap.resolver.ShrinkwrapResolveGAVWithoutTransitiveDepsTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.016 sec

Results :

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

You must first set the active Maven profile in project properties to be either arq-managed for running on managed server or arq-remote for running on remote server. Then, to run the tests, right click on the project or individual classes and select Run As –> JUnit Test in the context menu.

Debug the Application

If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.

$ mvn dependency:sources
$ mvn dependency:resolve -Dclassifier=javadoc