A JBoss Project
Red Hat
ShrinkWrap

ShrinkWrap

Skip the Build!

Painless Packaging for Java

Shrinkwrap provides a simple mechanism to assemble archives like JARs, WARs, and EARs with a friendly, fluent API.

JavaArchive archive = ShrinkWrap.create(JavaArchive.class,"archive.jar")
   .addClasses(MyClass.class,MyOtherClass.class)
   .addResource("mystuff.properties");

From there you may deploy directly into any supported integration container like JBoss EmbeddedAS, GlassFish v3 Embedded, Jetty, or OpenEJB.  Or perhaps you'd like to export the archive to a file or exploded directory structure.  Maybe you'd prefer to serialize it over the network to a remote host.  The possibilities are limitless.

To boot, ShrinkWrap is the supported deployment mechanism of the Arquillian project, and together we render the testing of true enterprise components amiable as a puppy.  Where Java EE brought a POJO programming model to application development, we've brought it to testing.  You handle your business logic; we'll do the rest.

To foster community participation, the majority of documentation and examples are available through our Wiki.

Releases are available either via our Downloads section, or through the JBoss Maven Repository, which we recommend is configured in ${userHomeDir}/.m2/settings.xml:

<settings>
  ...
  <profiles>
    ...
    <profile>
      <id>jboss-public-repository</id>
      <repositories>
        <repository>
          <id>jboss-public-repository-group</id>
          <name>JBoss Public Maven Repository Group</name>
          <url>https://repository.jboss.org/nexus/content/groups/public/</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>jboss-public-repository-group</id>
          <name>JBoss Public Maven Repository Group</name>
          <url>https://repository.jboss.org/nexus/content/groups/public/</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>

  </profiles>

  <activeProfiles>
    <activeProfile>jboss-public-repository</activeProfile>
  </activeProfiles>
  ...
</settings>

ShrinkWrap may then be declared as a dependency:

 <project>
  ...   
  <dependencies>
  ...     
    <dependency>
      <groupId>org.jboss.shrinkwrap</groupId>
      <artifactId>shrinkwrap-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap</groupId>
      <artifactId>shrinkwrap-impl-base</artifactId>
      <scope>test</scope> <!-- Don't rely upon internals for compilation -->
    </dependency>
...   
</dependencies>
...
</project>

 

 

 

 

 

Prerequisites

ShrinkWrap is designed to have a minimal dependency set.

  • JRE5+ Runtime
  • No external libraries

External Blogs and Articles

Started JEE – Testing with Arquillian
Oct 15, 2013 5:54 PM

Some time ago I came to the point where I need to do integration tests for my JEE applications at work. In JEE6 I tried several testing frameworks two years ago, but none of them works very well, so we decided to skip this point and continue with end users tests and JUnit testing. But I never gave up the search for an testing framework for JEE6.

Tags:

Java EE Tip of the Day: @WebFilter Testing Using Arquillian, Warp, and Drone
Sep 6, 2013 12:08 PM

I was looking for a simple solution to test @WebFilter servlet filters. The tests that I had used a lot of mocks, but really just left me unsatisfied. It was not a real world production solution. How would they "really" behave in the actual server environment. I had been using Arquillian to do some testing of our CDI layer, and decided to try it on filters.

Tags:

Organizing deployments with Arquillian and Shrinkwrap
Feb 11, 2013 9:25 AM

Arquillian and ShrinkWrap are undoubtedly great tools for tests automation. However one of the most difficult parts is usually deployment description.

Tags:

View more external blogs and articles
         

Desktop wallpaper | Project Swag

Recent Commits

ALRubinger maven-release-plugin prepare for next development iteration
Mar 25, 2014 10:35 AM
ALRubinger maven-release-plugin prepare release 1.2.2
Mar 25, 2014 10:35 AM
ALRubinger SHRINKWRAP-476 Delete path from nestedArchives internal Map on Archive.delete call
Mar 3, 2014 5:23 AM
ALRubinger SHRINKWRAP-475 Fix JavaDocs in Archive API
Mar 3, 2014 2:03 AM
ALRubinger SHRINKWRAP-474 Fix bug in getAsType when target is an ArchiveAsset
Mar 3, 2014 1:59 AM