Main Content

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

Heroes of Java: Andrew Lee Rubinger

An interview of the ShrinkWrap lead and developer usability advocate at JBoss, Andrew Lee Rubinger. In the interview, he talks about the flat structure at JBoss, the impact of git on open source development and why testing *is* development.

Tags:

Make It Test-driven with CDI

Rafael Liu's presentation from Devoxx 2011 about using Arquillian to test CDI applications in-container. He also proposes an extension to Arquillian for include mock beans in a ShrinkWrap archive.

Tags:

Web Application Unit Test/Integration Test! Which Framework? (Part 2)

In part 1 of this post, I described the possible approaches/frameworks for unit testing of web applications. In this post, I concentrate on one framework, which is JBoss Arquillian. The contents of this post will be: What about JBoss Arquillian? Use Arquillian to Unit Test inside EClipse and JBoss 6 Secrets behind Scene: How Arquillian handles the Test?

Tags:

View more external blogs and articles
         

Desktop wallpaper | Project Swag

Recent Commits

Andrew Lee Rubinger maven-release-plugin prepare for next development iteration
Feb 9, 2012 6:43 AM
Andrew Lee Rubinger maven-release-plugin prepare release shrinkwrap-parent-1.0.0-cr-3
Feb 9, 2012 6:43 AM
Davide D'Alto SHRINKWRAP-336 Provide addAsServiceProvider overload that supports String
Dec 21, 2011 1:16 AM
Andrew Lee Rubinger maven-release-plugin prepare for next development iteration
Dec 15, 2011 5:32 PM
Andrew Lee Rubinger maven-release-plugin prepare release 1.0.0-cr-2
Dec 15, 2011 5:32 PM