Announcement:1.0.0-alpha-12 Released
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
- Java EE 6 Testing Part II - Introduction to Arquillian and ShrinkWrap
-
In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container, lookup a bean in the project classpath and run a very simple integration test. This post focus on Arquillian and ShrinkWrap and why they are awesome tools for integration testing of enterprise Java applications.
- Using the ShrinkWrap Maven Resolver for Arquillian Tests
-
This post assumes that you're familiar with using Arquillian for testing Java applications. If you're not familiar with Arquillian, then I suggest you check out the guides at http://www.arquillian.org where you'll learn how to write Java tests that can run on the server and are much easier to write and maintain.
Tags: arquillian shrinkwrap maven resolver tutorial author:DavidSalter
- Arquillian initially overpromises and frustrates, but delivers real benefits
-
Documents first impressions and experiences with Arquillian, a story about how Arquillian found a critical bug in an app server and some suggestions for how to improve Arquillian.
Tags: arquillian experience criticism story opinion shrinkwrap author:CraigRinger
Useful Links
Recent Commits
- Tommy Tynja SHRINKWRAP-407 IOUtil now buffers writes correctly, avoiding java.lang.IndexOutOfBoundsException
- May 18, 2012 8:40 PM
- Andrew Lee Rubinger maven-release-plugin prepare for next development iteration
- May 10, 2012 2:50 AM
- Andrew Lee Rubinger maven-release-plugin prepare release 1.1.0-alpha-2
- May 10, 2012 2:50 AM
- Andrew Lee Rubinger Merge: pull request #56 from goldmann/license
- May 8, 2012 10:48 AM
- Marek Goldmann Added: LICENSE file
- May 8, 2012 5:02 AM