<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Exit Condition</title>
	<atom:link href="http://exitcondition.alrubinger.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://exitcondition.alrubinger.com</link>
	<description>Andrew Lee Rubinger</description>
	<lastBuildDate>Wed, 19 Jun 2013 10:15:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='exitcondition.alrubinger.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Exit Condition</title>
		<link>http://exitcondition.alrubinger.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://exitcondition.alrubinger.com/osd.xml" title="Exit Condition" />
	<atom:link rel='hub' href='http://exitcondition.alrubinger.com/?pushpress=hub'/>
		<item>
		<title>Our Maven Dependency Resolver Goes 2.0.0 Final</title>
		<link>http://exitcondition.alrubinger.com/2013/06/19/resolvers-goes-final/</link>
		<comments>http://exitcondition.alrubinger.com/2013/06/19/resolvers-goes-final/#comments</comments>
		<pubDate>Wed, 19 Jun 2013 09:32:25 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/?p=361</guid>
		<description><![CDATA[Well folks, after plenty of API refinements and battle-testing within our own projects at the JBoss Community, we&#8217;re proud to offer ShrinkWrap Resolver at a locked 2.0.0 release.  I&#8217;m posting the full user guide here, but the TL;DR of it is this: it&#8217;s an API for you to pull down Maven artifacts (and optionally their [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=361&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div>
<p><img class="alignleft" alt="" src="http://design.jboss.org/shrinkwrap/logo/images/shrinkwrap_logo_450px.gif" width="450" height="100" /></p>
<p>Well folks, after plenty of API refinements and battle-testing within our own projects at the JBoss Community, we&#8217;re proud to offer ShrinkWrap Resolver at a locked 2.0.0 release.  I&#8217;m posting the full user guide here, but the TL;DR of it is this: it&#8217;s an API for you to pull down Maven artifacts (and optionally their dependencies) in a simple fashion.  The project requires zero dependencies, will work on any JRE5+ runtime, and is open source with an Apache License 2.0 hosted here: <a href="https://github.com/shrinkwrap/resolver" target="_blank">https://github.com/shrinkwrap/resolver</a>.  Have at it.</p>
<p>Special thanks go out to our contributors:</p>
<p>Ales Justin<br />
Andrew Lee Rubinger<br />
Aslak Knutsen<br />
Bernard Labno<br />
Carlo de Wolf<br />
Davide D&#8217;Alto<br />
George Gastaldi<br />
Ivan Pazmino<br />
Jörg Prante<br />
joserodolfofreitas<br />
Karel Piwko<br />
Michal Matloka<br />
Sachin Patil<br />
Samuel Santos<br />
Tair Sabirgaliev<br />
Thomas Segismont<br />
Tommy Tynja</p>
<p>&#8230;with special note to Karel Piwko from our JBoss QE department for both championing the concept of this project and its utility AND providing the proof-of-concept and implementations which lead to our solving the issue of nontrivial deployments in Arquillian in a sane way that didn&#8217;t involve too much software guesswork or cyclic build problems.  Enjoy!</p>
<p>S,</p>
<p><a href="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif"><img class="alignnone size-full wp-image-167" alt="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640"   /></a></p>
<p>ALR</p>
<h2><a class="anchor" href="#introduction-to-shrinkwrap-resolvers" name="introduction-to-shrinkwrap-resolvers"></a>Introduction to ShrinkWrap Resolvers</h2>
<div>
<div>
<p>Often we don’t control the construction of these libraries, and we certainly shouldn’t be in the business of re-assembling them (and hence further differentiating our tests from the our production runtime deployments). With the advent of Maven and other build systems, typically thirdparty libraries and our own dependent modules are obtained from a backing software <em>repository</em>. In this case we supply a series of coordinates which uniquely identifies an artifact in the repository, and resolve the target files from there.</p>
</div>
<div>
<p>That is precisely the aim of the ShrinkWrap Resolvers project; it is a Java API to obtain artifacts from a repository system. Currently implemented are grammars and support for Maven-based repository structures (this is separate from the use of Maven as a project management system or build tool; it’s possible to use a Maven repository layout with other build systems).</p>
</div>
<div>
<p>ShrinkWrap Resolvers is comprised of the following modules:</p>
</div>
<table>
<tbody>
<tr>
<td><em>Name</em></td>
<td><em>Maven Coordinates</em></td>
</tr>
<tr>
<td>API</td>
<td>org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api</td>
</tr>
<tr>
<td>SPI</td>
<td>org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi</td>
</tr>
<tr>
<td>Maven API</td>
<td>org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven</td>
</tr>
<tr>
<td>Maven SPI</td>
<td>org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi-maven</td>
</tr>
<tr>
<td>Maven Implementation</td>
<td>org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven</td>
</tr>
<tr>
<td>Maven Implementation with Archive Integration</td>
<td>org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven-archive</td>
</tr>
</tbody>
</table>
<div>
<p>The separation between the Maven and non-Maven modules is there to enforce modular design and separate out generic resolution from Maven-specific grammars, should the project support other mechanisms in the future.</p>
</div>
</div>
</div>
<div>
<h2><a class="anchor" href="#adding-shrinkwrap-resolvers-to-your-project" name="adding-shrinkwrap-resolvers-to-your-project"></a>Adding ShrinkWrap Resolvers to your project</h2>
<div>
<div>
<p>Obtaining ShrinkWrap Resolvers for use in your system can be done in a single pass by declaring a dependency upon the <tt>depchain</tt> module in a Maven <em>pom.xml</em>:</p>
</div>
<div>
<div>
<pre><code>&lt;dependencies&gt;
    ...
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-depchain&lt;/artifactId&gt;
      &lt;version&gt;2.0.0&lt;/version&gt; &lt;!-- Or whatever version you need --&gt;
      &lt;scope&gt;test&lt;/scope&gt;
      &lt;type&gt;pom&lt;/type&gt;
    &lt;/dependency&gt;
    ...
&lt;/dependencies&gt;</code></pre>
</div>
</div>
<div>
<p>This will bring the APIs into the test classpath and the SPIs and Implementation modules into the runtime classpaths (which will not be transitively inherited, as per Maven rules in <tt>runtime</tt> scope).</p>
</div>
<div>
<p>Alternatively, you can have finer-grained control over using ShrinkWrap Resolvers by bringing in each module manually:</p>
</div>
<div>
<div>
<pre><code> &lt;dependencies&gt;
    ...
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-api&lt;/artifactId&gt;
      &lt;version&gt;${version.shrinkwrap.resolvers}&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-spi&lt;/artifactId&gt;
      &lt;version&gt;${version.shrinkwrap.resolvers}&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-api-maven&lt;/artifactId&gt;
      &lt;version&gt;${version.shrinkwrap.resolvers}&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-spi-maven&lt;/artifactId&gt;
      &lt;version&gt;${version.shrinkwrap.resolvers}&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-impl-maven&lt;/artifactId&gt;
      &lt;version&gt;${version.shrinkwrap.resolvers}&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-impl-maven-archive&lt;/artifactId&gt;
      &lt;version&gt;${version.shrinkwrap.resolvers}&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    ...
  &lt;/dependencies&gt;</code></pre>
</div>
</div>
<div>
<table>
<tbody>
<tr>
<td>
<div>Important</div>
</td>
<td>
<div>
<p>If you happen to use Arquillian BOM in <tt>&lt;dependencyManagement&gt;</tt>, it already contains a ShrinkWrap Resolvers version. You must import ShrinkWrap Resolvers BOMs preceding Arquillian BOM in order to get 2.0.0-x version. Adding a ShrinkWrap BOM is recommended in any case.</p>
</div>
<div>
<p>ShrinkWrap resolved BOM can be imported via following snippet:</p>
</div>
<div>
<div>
<pre><code>&lt;dependencyManagement&gt;
  &lt;dependencies&gt;
    ...
    &lt;!-- Override dependency resolver with latest version.
         This must go *BEFORE* the Arquillian BOM. --&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-bom&lt;/artifactId&gt;
      &lt;version&gt;${version.shrinkwrap.resolvers}&lt;/version&gt;
      &lt;scope&gt;import&lt;/scope&gt;
      &lt;type&gt;pom&lt;/type&gt;
    &lt;/dependency&gt;
    ...
  &lt;/dependencies&gt;
&lt;/dependencyManagement&gt;</code></pre>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<h2><a class="anchor" href="#resolving-dependencies" name="resolving-dependencies"></a>Resolving dependencies</h2>
<div>
<div>
<p>The general entry point for resolution is the convenience <tt>org.jboss.shrinkwrap.resolver.api.maven.Maven</tt> class, which has static hooks to obtain a new <tt>org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem</tt>.<br />
Let’s cover most popular use cases for ShrinkWrap Resolver.</p>
</div>
<div>
<h3><a class="anchor" href="#resolution-of-artifacts-specified-by-maven-coordinates" name="resolution-of-artifacts-specified-by-maven-coordinates"></a>Resolution of artifacts specified by Maven coordinates</h3>
<div>
<p>Maven coordinates, in their canonical form, are specified as following <tt>groupId:artifactId:[packagingType:[classifier]]:version</tt>. Often, those are referred as <tt>G</tt> (groupId), <tt>A</tt> (artifactId), <tt>P</tt> (packagingType), <tt>C</tt> (classifier) and <tt>V</tt> (version). If you omit <tt>P</tt> and <tt>C</tt>, they will get their default value, which is packaging of <tt>jar</tt> and an empty classifier. ShrinWrap Resolver additionally allows you to skip <tt>V</tt> in case it has version information available, that would be explained later on.</p>
</div>
<div>
<ol>
<li>The most simple use case is to resolve a file using coordinates. Here, resolver locates artifact defined by <tt>G:A:V</tt> and resolves it including all transitive dependencies. Result is formatted as array of <tt>File</tt>.
<div>
<div>
<pre><code>File[] = Maven.resolver().resolve("G:A:V").withTransitivity().asFile();</code></pre>
</div>
</div>
</li>
<li>You might want to change default Maven behavior and resolve only artifact specified by <tt>G:A:V</tt>, avoiding its transitive dependencies. For such use case, ShrinkWrap Resolvers provides a shorthand for changing resolution strategy, called <tt>withoutTransitivity()</tt>. Additionally, you might want to return a single <tt>File</tt> instead of an array.
<div>
<div>
<pre><code>Maven.resolver().resolve("G:A:V").withoutTransitivity().asSingleFile();</code></pre>
</div>
</div>
</li>
<li>Very often, you need to resolve more than one artifact. The method <tt>resolve(String…)</tt> allows you to specify more artifacts at the same time. The result of the call will be an array of <tt>File</tt> composed by artifacts defined by <tt>G1:A1:V1</tt> and <tt>G2:A2:V2</tt> including their transitive dependencies.
<div>
<div>
<pre><code>Maven.resolver().resolve("G1:A1:V1", "G2:A1:V1").withTransitivity().asFile();</code></pre>
</div>
</div>
</li>
<li>Resolving a dependency with specific packaging type. Packaging type is specified by <tt>P</tt> in <tt>G:A:P:V</tt> coordinates description.
<div>
<div>
<pre><code>Maven.resolver().resolve("G:A:war:V").withTransitivity().asFile();</code></pre>
</div>
</div>
<div>
<p>Packaging can be of any type, the most common are listed in following table.</p>
</div>
<p>Table 1. Packaging types</p>
<table>
<tbody>
<tr>
<td>jar</td>
<td>war</td>
<td>ear</td>
<td>ejb</td>
<td>rar</td>
<td>par</td>
<td>pom</td>
<td>test-jar</td>
<td>maven-plugin</td>
</tr>
</tbody>
</table>
</li>
<li>Resolving a dependency with specific classifier. With classifier, such as <tt>tests</tt>, you need to include all <tt>G:A:P:C:V</tt> parts of coordinates string.
<div>
<div>
<pre><code>Maven.resolver().resolve("G:A:test-jar:tests:V").withTransitivity().asFile();</code></pre>
</div>
</div>
</li>
<li>Returning resolved artifacts as different type than file. ShrinkWrap Resolvers provides shorthands for returning an <tt>InputStream</tt> instead of <tt>File</tt>. Additionally, with <tt>shrinkwrap-resolver-maven-impl-archive</tt>, you can additionally return results as ShrinkWrap archives, such as <tt>JavaArchive</tt>, <tt>WebArchive</tt> or <tt>EnterpriseArchive</tt>.
<div>
<div>
<pre><code>Maven.resolver().resolve("G:A:V").withTransitivity().as(File.class);
Maven.resolver().resolve("G:A:V").withTransitivity().as(InputStream.class);
Maven.resolver().resolve("G:A:V").withTransitivity().as(JavaArchive.class);
Maven.resolver().resolve("G:A:war:V").withoutTransitivity().asSingle(WebArchive.class);</code></pre>
</div>
</div>
<div>
<table>
<tbody>
<tr>
<td>
<div>Note</div>
</td>
<td>
<div>
<p>It’s the responsibility of caller to close <tt>InputStream</tt>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
<li>Working with artifact metadata. Sometimes, you are more interested in metadata, such as dependencies of a given artifacts instead of artifact itself. ShrinkWrap Resolvers provides you an API for such use cases:
<div>
<div>
<pre><code>MavenResolvedArtifact artifact = Maven.resolver().resolve("G:A:war:V").withoutTransitivity()
  .asSingle(MavenResolvedArtifact.class);

MavenCoordinate coordinates = artifact.getCoordinate();
MavenArtifactInfo[] dependencies = artifact.getDependencies();
String version = artifact.getResolvedVersion();
ScopeType scope = artifact.getScope();</code></pre>
</div>
</div>
<div>
<p>You can still retrieve resolved artifact from <tt>MavenResolvedArtifact</tt>:</p>
</div>
<div>
<div>
<pre><code>File file = artifact.asFile();</code></pre>
</div>
</div>
</li>
<li>Excluding a dependency of the artifact you want to resolve. In case you need to resolve an artifact while avoiding some of its dependencies, you can follow concept of <tt>&lt;exclusions&gt;</tt> known for Maven. Following snippet shows how to exclude <tt>G:B</tt> while resolving <tt>G:A:V</tt>.
<div>
<div>
<pre><code>Maven.resolver()
  .addDependencies(
    MavenDependencies.createDependency("G:A:V", ScopeType.COMPILE, false,
      MavenDependencies.createExclusion("G:B"))).resolve().withTransitivity().asFile();</code></pre>
</div>
</div>
</li>
<li>Using a strategy to control what will be resolved. In special cases, excluding a single dependency is not the behaviour you want to achieve. For instance, you want to resolve all test scoped dependencies of an artifact, you want to completely avoid some dependency while resolving multiple artifacts or maybe you’re interested in optional dependencies. For those cases, ShrinkWrap Resolvers allows you to specify a <tt>MavenResolutionStrategy</tt>. For instance, you can exclude <tt>G:B</tt> from <tt>G:A:V</tt> (e.g. the same as previous examples) via following snippet:
<div>
<div>
<pre><code>Maven.resolver().resolve("G:A:V").using(new RejectDependenciesStrategy(false, "G:B")).asFile();</code></pre>
</div>
</div>
<div>
<table>
<tbody>
<tr>
<td>
<div>Note</div>
</td>
<td>
<div>
<p>Methods <tt>withTransitivity()</tt> and <tt>withoutTransitivity</tt> are just a convenience methods to avoid you writing down strategy names. The first one calls <tt>TransitiveStrategy</tt> while the latter calls <tt>NotTransitiveStrategy</tt>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<p>Strategies are composed of an array of <tt>MavenResolutionFilter</tt> instances and <tt>TransitiveExclusionPolicy</tt> instance. While defining the first allows you to transform dependency graph of resolved artifacts, the latter allows you to change default behavior when resolving transitive dependencies. By default, Maven does not resolve any dependencies in <em>provided</em> and <em>test</em> scope and it also skips <em>optional</em> dependencies. ShrinkWrap resolver behaves the same way by default, but allows you to change that behaviour. This comes handy especially if when you want to for instance resolve all provided dependencies of <tt>G:A:V</tt>. For your convenience, ShrinkWrap Resolvers ships with strategies described in following table.</p>
</div>
<p>Table 2. Strategies available in ShrinkWrap Resolver</p>
<table>
<tbody>
<tr>
<td><tt>AcceptAllStrategy</tt></td>
<td>Accepts all dependencies of artifacts. Equals <tt>TransitiveStrategy</tt>.</td>
</tr>
<tr>
<td><tt>AcceptScopesStrategy</tt></td>
<td>Accepts only dependencies that have defined scope type.</td>
</tr>
<tr>
<td><tt>CombinedStrategy</tt></td>
<td>This allows you to combine multiple strategies together. The behaviour defined as logical AND between combined strategies.</td>
</tr>
<tr>
<td><tt>NonTransitiveStrategy</tt></td>
<td>Rejects all dependencies that were not directly specified for resolution. This means that all transitive dependencies of artifacts for resolution are rejected.</td>
</tr>
<tr>
<td><tt>RejectDependenciesStrategy</tt></td>
<td>Rejects dependencies defined by <tt>G:A</tt> (version is not important for comparison, so it can be omitted altogether). By default, it is transitive: <tt>RejectDependenciesStrategy("G:A", "G:B")</tt> means that all dependencies that origin at <tt>G:A</tt> or <tt>G:B</tt> are removed as well. If you want to change that behavior to reject defined dependencies but to keep their descendants, instantiate strategy as following: <tt>RejectDependenciesStrategy(false, "G:A", "G:B")</tt></td>
</tr>
<tr>
<td><tt>TransitiveStrategy</tt></td>
<td>Acceps all dependencies of artifacts. Equals <tt>AcceptAllStrategy</tt>.</td>
</tr>
</tbody>
</table>
</li>
<li>Control sources of resolution. ShrinkWrap Resolvers allows you to specify where do you want to resolve artifacts from. By default, it uses classpath (also known as Maven Reactor) and Maven Central repository, however you can programmatically alter the behavior.
<div>
<div>
<pre><code>Maven.resolver().resolve("G:A:V").withClassPathResolution(false).withTransitivity().asFile();
Maven.resolver().resolve("G:A:V").withMavenCentralRepo(false).withTransitivity().asFile();
Maven.resolver().offline().resolve("G:A:V").withTransitivity().asFile();</code></pre>
</div>
</div>
<div>
<p>While classpath resolution is handy for testing SNAPSHOT artifacts that are not yet installed in any of the Maven repository, making ShrinkWrap Resolvers offline avoids accessing any repositories but local cache.</p>
</div>
</li>
<li>While controlling classpath resolution and Maven Central comes handy, sometimes you might want to specify completely different <em>settings.xml</em> file than default for your test execution. This can be done via following API calls:
<div>
<div>
<pre><code>Maven.configureResolver().fromFile("/path/to/settings.xml")
  .resolve("G:A:V").withTransitivity().asFile();

Maven.configureResolver().fromClassloaderResource("path/to/settings.xml")
  .resolve("G:A:V").withTransitivity().asFile();</code></pre>
</div>
</div>
<div>
<table>
<tbody>
<tr>
<td>
<div>Warning</div>
</td>
<td>
<div>
<p>ShrinkWrap Resolvers will not consume settings.xml you specified on command line (<tt>-s settings.xml</tt>) or in the IDE. It reads settings.xml files at their standard locations, which are <tt>~/.m2/settings.xml</tt> and <tt>$M2_HOME/conf/settings.xml</tt> unless overridden in the API or via System property.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
</ol>
</div>
</div>
<div>
<h3><a class="anchor" href="#resolution-of-artifacts-defined-in-pom-files" name="resolution-of-artifacts-defined-in-pom-files"></a>Resolution of artifacts defined in POM files</h3>
<div>
<p>While previous calls allow you to manually define what you want to resolve, in Maven projects, you have very likely specified this information already, in you <em>pom.xml</em> file. ShrinkWrap Resolvers allows you to follow <em>DRY</em> principle and it is able to load metadata included there.</p>
</div>
<div>
<p>ShrinkWrap Resolvers constructs so called effective POM model (simplified, that is your <em>pom.xml</em> file plus parent hierarchy and Super POM, Maven default POM file). In order to construct the model, it uses all local repository, classpath repository and remote repositories. Once the model is loaded, you can use the metadata in there to be automatically added to artifacts to be resolved.</p>
</div>
<div>
<ol>
<li>Resolving an artifact with version defined in effective POM. In case, you want to resolve <tt>G:A:V</tt>, you can simply specify <tt>G:A</tt> instead. For artifacts with non JAR packaging type or classifier, you must use alternative syntax with question mark <em><tt>?</tt></em>, such as <tt>G:A:P:?</tt> or <tt>G:A:P:C:?</tt>.
<div>
<div>
<pre><code>Maven.resolver().loadPomFromFile("/path/to/pom.xml").resolve("G:A").withTransitivity().asFile();

Maven.resolver().loadPomFromClassLoaderResource("/path/to/pom.xml").resolve("G:A:P:?")
  .withTransitivity().asFile();</code></pre>
</div>
</div>
</li>
<li>Resolving artifacts defined in effective POM. ShrinkWrap Resolvers allows you to artifacts defined with specific scope into list of artifacts to be resolved. This way, you don’t need to alter your tests if you change dependencies of your application. You can either use <tt>importDependencies(ScopeType…)</tt> or convenience methods, that cover the most frequent usages (<tt>importRuntimeDependencies()</tt>, <tt>importTestDependencies()</tt> and <tt>importRuntimeAndTestDependencies()</tt>:
<div>
<div>
<pre><code>Maven.resolver().loadPomFromFile("/path/to/pom.xml")
  .importDependencies(ScopeType.TEST, ScopeType.PROVIDED)
  .resolve().withTransitivity().asFile();

Maven.resolver().loadPomFromFile("/path/to/pom.xml").importRuntimeDependencies()
  .resolve().withTransitivity().asFile();</code></pre>
</div>
</div>
<div>
<table>
<tbody>
<tr>
<td>
<div>Tip</div>
</td>
<td>
<div>
<p>Runtime in convenience methods means all the Maven scopes that are used in application runtime, which are <tt>compile</tt>, <tt>runtime</tt>, <tt>import</tt> and <tt>system</tt>. If you need to select according to Maven scopes, go for <tt>importDependencies(ScopeType…)</tt> instead.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
<li>Specifying plugins to be activated. By default, ShrinkWrap Resolvers activates profiles based on property value, file presence, active by default profiles, operating system and JDK. However, you can force profiles in same way as you would do via <tt>-P</tt> in Maven.
<div>
<div>
<pre><code>Maven.resolver().loadPomFromFile("/path/to/pom.xml", "activate-profile-1", "!disable-profile-2")
        .importRuntimeAndTestDependencies().resolve().withTransitivity().asFile();</code></pre>
</div>
</div>
</li>
</ol>
</div>
</div>
<div>
<h3><a class="anchor" href="#system-properties" name="system-properties"></a>System properties</h3>
<div>
<p>ShrinkWrap Resolvers allows you to override any programmatical configuration via System properties.</p>
</div>
<p>Table 3. System properties altering behavior of ShrinkWrap Resolvers</p>
<table>
<tbody>
<tr>
<td><tt>org.apache.maven.user.settings</tt></td>
<td>Path to user <em>settings.xml</em> file. In case both settings are provided, they are merged, user one has the priority.</td>
</tr>
<tr>
<td><tt>org.apache.maven.global-settings</tt></td>
<td>Path to global <em>settings.xml</em> file. In case both settings are provided, they are merged, user one has the priority.</td>
</tr>
<tr>
<td><tt>org.apache.maven.security-settings</tt></td>
<td>Path to <em>settings-security.xml</em>, that contains encrypted master password for password protected Maven repositories.</td>
</tr>
<tr>
<td><tt>org.apache.maven.offline</tt></td>
<td>Flag there to work in offline mode.</td>
</tr>
<tr>
<td><tt>maven.repo.local</tt></td>
<td>Path to local repository with cached artifacts. Overrides value defined in any of the <em>settings.xml</em> files.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<h2><a class="anchor" href="#experimental-features" name="experimental-features"></a>Experimental features</h2>
<div>
<div>
<table>
<tbody>
<tr>
<td>
<div>Warning</div>
</td>
<td>
<div>
<p>Following features are in their early development stages. However, they should work for the most common use case. Feel free to report a bug in <a href="https://issues.jboss.org/browse/SHRINKRES">SHRINKRES</a> project if that not your case.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h3><a class="anchor" href="#shrinkwrap-resolver-maven-plugin" name="shrinkwrap-resolver-maven-plugin"></a>ShrinkWrap Resolver Maven Plugin</h3>
<div>
<p>ShrinkWrap Resolver Maven plugin allows you to propagate settings you specified on command line into test execution. Settings comprises of: paths to the <em>pom.xml</em> file and <em>settings.xml</em> files, activated/disabled profiles, offline flag and path to local repository. No support for IDE exists at this moment.</p>
</div>
<div>
<p>In order to activate the plugin, you need to add following snippet into <tt>&lt;build&gt;</tt> section of your <em>pom.xml</em> file.</p>
</div>
<div>
<div>
<pre><code>&lt;plugin&gt;
  &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
  &lt;artifactId&gt;shrinkwrap-resolver-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;${version.shrinkwrap.resolvers}&lt;/version&gt;
  &lt;executions&gt;
    &lt;execution&gt;
      &lt;goals&gt;
        &lt;goal&gt;propagate-execution-context&lt;/goal&gt;
      &lt;/goals&gt;
    &lt;/execution&gt;
  &lt;/executions&gt;
&lt;/plugin&gt;</code></pre>
</div>
</div>
<div>
<p>Then, in your test you can do the following:</p>
</div>
<div>
<div>
<pre><code>Maven.configureResolverViaPlugin().resolve("G:A").withTransitivity().asFile();</code></pre>
</div>
</div>
</div>
<div>
<h3><a class="anchor" href="#maven-importer" name="maven-importer"></a>Maven Importer</h3>
<div>
<p>MavenImporter is the most advanced feature of ShrinkWrap Resolvers. Instead of you being resposible for specifying how testing archive should look like, it reuses information defined in your <em>pom.xml</em> in order to construct the archive. So, no matter how your project looks like, you can get a full archive, as you would deploy it into the application server within a single like of code.</p>
</div>
<div>
<p>MavenImporter is able to compile sources, construct <em>MANIFEST.MF</em>, fetch the dependencies and construct archive as Maven would do. It does not required any data to be prepared by Maven, however it can profit from those if they exist.</p>
</div>
<div>
<div>
<pre><code>ShrinkWrap.create(MavenImporter.class)
  .loadPomFromFile("/path/to/pom.xml").importBuildOutput().as(WebArchive.class);

ShrinkWrap.create(MavenImporter.class)
  .loadPomFromFile("/path/to/pom.xml", "activate-profile-1", "!disable-profile-2")
  .importBuildOutput().as(WebArchive.class);

ShrinkWrap.create(MavenImporter.class).configureFromFile("/path/to/settings.xml")
  .loadPomFromFile("/path/to/pom.xml").importBuildOutput().as(JavaArchive.class);</code></pre>
</div>
</div>
<div>
<table>
<tbody>
<tr>
<td>
<div>Important</div>
</td>
<td>
<div>
<p>Maven Importer does not currently support other packagings but JAR and WAR. Also, it does not honor many of Maven plugins, currently it supports their limited subset.</p>
</div>
<div>
<p>Additionally, using different JDK for running tests and compiling sources is not supported, although it should work if you are for instance compiling sources targeting JDK6 while being bootstrapped on JDK7.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=361&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2013/06/19/resolvers-goes-final/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://design.jboss.org/shrinkwrap/logo/images/shrinkwrap_logo_450px.gif" medium="image" />

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
		<item>
		<title>Continuous Enterprise Development: The JavaOne Session</title>
		<link>http://exitcondition.alrubinger.com/2012/10/03/con5312/</link>
		<comments>http://exitcondition.alrubinger.com/2012/10/03/con5312/#comments</comments>
		<pubDate>Wed, 03 Oct 2012 16:32:14 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/?p=344</guid>
		<description><![CDATA[Parents aren&#8217;t supposed to play favorites with their children, but there&#8217;s always that one kid you&#8217;re just really proud of, right?  Admit it. In my case at JavaOne 2012, it&#8217;s my last session with Aslak: &#8220;Continuous Enterprise Development: Case Studies in Java EE Integration Testing&#8221;.  We hit the stage at the Parc55 again in Cyril Magnin [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=344&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Parents aren&#8217;t supposed to play favorites with their children, but there&#8217;s always that one kid you&#8217;re just really proud of, right?  Admit it.</p>
<p>In my case at JavaOne 2012, it&#8217;s my last session with <a href="https://twitter.com/aslakknutsen" target="_blank">Aslak</a>: &#8220;Continuous Enterprise Development: Case Studies in Java EE Integration Testing&#8221;.  We hit the stage at the Parc55 again in Cyril Magnin II/III Wednesday, 3 October, at 11:30 Pacific, and the session info can be found <a href="http://lanyrd.com/2012/javaone/sxgbz/" target="_blank">here</a>.  From the abstract:</p>
<blockquote><p>This highly technical session examines solutions for easing the testing of some of the more complex use cases within Java EE. Each example is backed by a runnable test (publicly available to participants), and the presentation covers automated continuous development of:</p>
<p>• The Web user interface (via Selenium)<br />
• Persistent data and JPA<br />
• Transactional boundaries<br />
• Cloud-based deployments<br />
• RESTful endpoints<br />
• More</p>
<p>It showcases various techniques outlined in the book Continuous Enterprise Development in Java, forthcoming from O’Reilly Media, and is delivered by the authors. Expect a lot of proof through open source demos. You&#8217;ll see the presenters exercise the features of any compliant Java EE 6 runtime, using the Arquillian platform.</p></blockquote>
<p>My team&#8217;s been lucky enough to enjoy some very positive feedback from our sessions over the years, but one comment we sometimes receive is that the message can be a little &#8220;soft&#8221; as we&#8217;ve catered to attendees of all skill levels.  So it&#8217;ll be interesting to see how this hour plays out, as the slide content will be limited to some supporting theory and the real meat of the course will be spent examining some solutions to the rougher edges of Java EE development.</p>
<p>I always want to kick myself for putting &#8220;Testing&#8221; in the title of these things, because that implies something separate from &#8220;real&#8221; development.  In truth the opposite is more accurate.  I&#8217;m fond of saying that &#8220;Testing <em>is</em> Development&#8221;, but the sentiment is better expressed by <a href="https://twitter.com/jeremynorris" target="_blank">Jeremy Norris</a>:</p>
<blockquote><p>The purpose of automated testing is to enable change. Verifying correctness is just a nice side effect.</p></blockquote>
<p>&#8230;or <a href="https://twitter.com/tottinge" target="_blank">Tim Ottinger</a>:</p>
<blockquote><p>Move testing from the caboose to the engine.</p></blockquote>
<p><a href="https://twitter.com/mojavelinux" target="_blank">Dan Allen</a> voices the soundbyte &#8220;Coding with Confidence&#8221;.  Whichever way you spin it, the point is to consider testing a first-class citizen within your code.  In fact, I place it in order of importance somewhere below API design but definitely above implementation bits.  It&#8217;s a decent testsuite that enables me to brazenly work on a month-long refactoring that results in a 4000-line patch to be committed and released together.  The API is your contract with calling client code;  the testsuite is the contract your implementation has with your API.</p>
<p>So today&#8217;s session is going to cover the <em>testable development</em> of roughly 5 use cases.  I say &#8220;roughly&#8221; because we&#8217;ll favor quality over quantity; we want the talk to be fairly interactive with observations and suggestions from the attendees, so if we have to punt on some of the examples in order to give more complete coverage to a a fewer number, so be it.</p>
<p><strong>Working with Data</strong></p>
<p>One of the questions we most often receive revolves around interacting with a database.  The point of an application is to <em>do stuff</em> to state, and most programs require persistent state in some form or another.  Today we&#8217;ll focus a bit on relational mechanisms via JPA.</p>
<p>The example we&#8217;ll pull from here is a work-in-progress for the <a href="http://continuousdev.org" target="_blank">Book</a>, a standard N-tier application with a JSF frontend.  While we spend a lot of time talking about the importance of integration testing alongside a backing container, we shouldn&#8217;t forget the obvious utility obtained by exercising unit tests as well.  <a href="http://jcp.org/en/jsr/detail?id=303" target="_blank">Bean Validation</a> definitions on the entity model are a wonderful candidate for standalone bootstrapping thanks to <a href="http://www.hibernate.org/subprojects/validator.html" target="_blank">Hibernate Validator</a>, so we&#8217;ll ease into the talk with a quick analysis of <a href="https://github.com/arquillian/continuous-enterprise-development/blob/5_j1/application/domain/conference/src/test/java/org/ced/domain/conference/DomainValidationTestCase.java" target="_blank">this in action</a>.  Also, <a href="https://twitter.com/emmanuelbernard" target="_blank">Emmanuel</a> is in town and we like to make him smile.</p>
<p>With the easy stuff out of the way, we move along to an <a href="https://github.com/arquillian/continuous-enterprise-development/blob/5_j1/application/domain/relation/src/test/java/org/ced/domain/relation/test/RelationTestCase.java" target="_blank">integration test which uses</a> the <a href="https://github.com/arquillian/arquillian-extension-persistence" target="_blank">Arquillian Persistence Extension</a> to prepopulate data before testing from an external model, returning the database to a configurable (row-level or table-level) state when done.  Additionally, we can configure the feature to use transactions under the hood to roll back all changes made by the test upon test completion.  Sidenote: one of my favorite things about this extension is that it&#8217;s lead by a community contributor, <a href="https://twitter.com/majson" target="_blank">Bartosz</a>.  A simple annotation on the test methods does the dirty work for us:</p>
<pre>@UsingDataSet("test_objects.yml")</pre>
<p><a href="https://github.com/arquillian/continuous-enterprise-development/blob/5_j1/application/domain/relation/src/test/resources/datasets/test_objects.yml" target="_blank">This</a> simple <a href="http://en.wikipedia.org/wiki/YAML" target="_blank">YAML</a> file defines our source data for use in testing.</p>
<p><strong>The View Layer</strong></p>
<p>On the other end of the spectrum, seeing our data returned in the expected format is more than a nice bonus.  Of course, parsing out the possibly huge output from an HTML page can be a bit of a drag, so we&#8217;ve got a few tools to help in this department.</p>
<p>We use the same example here as we did with data, this time centering on the <a href="https://github.com/arquillian/continuous-enterprise-development/blob/5_j1/application/web/conference/src/test/java/org/ced/web/conference/test/ConferenceTestCase.java">ConferenceTestCase</a>.  There&#8217;s a <em>lot</em> going on here.</p>
<p>Remember that white-box testing allows us to inspect the inside of a system, while black-box testing focuses on the outside view.  With the following annotations above the test class, we&#8217;d like to introduce &#8220;gray-box&#8221; testing:</p>
<pre>@WarpTest
@RunAsClient</pre>
<p><a href="https://github.com/arquillian/arquillian-extension-warp" target="_blank">Arquillian Warp</a> is an extension which allows a test to both initiate a client-side request <em>and</em> perform assertions on server-side logic from inside the container.</p>
<p><a href="https://github.com/arquillian/arquillian-extension-drone" target="_blank">Arquillian Drone</a> lets us simply control the lifecycle of <a href="http://seleniumhq.org/" target="_blank">Selenium</a>, through which we&#8217;ll examine UI output via a real web browser.  With the addition of <a href="https://github.com/arquillian/arquillian-graphene" target="_blank">Arquillian Graphene</a>, we&#8217;re given an object model view of the DOM like this:</p>
<pre>@FindBy(id = "conference")
private ConferenceView conferenceView;</pre>
<p>Using this mechanism we may actually &#8220;mock&#8221; the data model used to render the response <em>without going to the database</em>.</p>
<p>Likely this example on its own should go into its own blog post, and it&#8217;ll definitely be used in the book.  So we&#8217;ll let it mature a bit then document it fully. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Testing Close to the Production Environment</strong></p>
<p>With the advent of Cloud it&#8217;s become quite easy and cheap for us to spin up instances that are nearly equal in their makeup.  Because we should aim to exercise our application in an environment as close as possible to Production, it&#8217;s nice to take advantage of this setup as either a remote personal server extension to our development environment, or as a shared staging server for the development team.  We&#8217;ll see three approaches to interacting with <a href="https://openshift.redhat.com/app/">OpenShift</a>.</p>
<ul>
<li>Attach a debugger from your development machine to the remote instance, allowing inspection of running code and hotswap.</li>
<li>Trigger Jenkins builds from a repository push, and on successful build, push changes to the staging and/or production instances</li>
<li>Use the <a href="https://github.com/arquillian/arquillian-container-openshift">Arquillian OpenShift Container</a> to execute locally-initiated client tests upon a remote instance in the cloud.</li>
</ul>
<p>The demo we&#8217;ll use for this is located <a href="http://bit.ly/CON5312-DEMO" target="_blank">here</a>.  Go ahead and put your personal mark into what will become our test data!</p>
<p><strong>Transactions in Action</strong></p>
<p>I&#8217;ve always liked showing how to leverage in-container testing to perform assertions on the configuration.  One of my favorite demos from the EJB 3.1 book shows how a simple omission of a transactional annotation can result in a serious change to your application and potential loss of revenue.  Transactional boundaries are important to respect, and they must be set appropriately.</p>
<p>Aslak has recently written another <a href="https://github.com/arquillian/arquillian-showcase/blob/universe/universe/src/test/java/org/jboss/arquillian/showcase/universe/core/ConferenceRepositoryTestCase.java" target="_blank">example</a> which allows the test case to gain control over the UserTransaction in play:</p>
<pre>@Inject
private UserTransaction transaction;</pre>
<p>From there we get to play around with generic Callable instances, really to wrap any action in a Tx:</p>
<pre>private  T transactional(Callable transactionalCallable) throws Exception {
  transaction.begin();
  T result = transactionalCallable.call();
  transaction.commit();
  return result;
}</pre>
<p>Motto: Don&#8217;t be afraid to dig into the inner workings of the container while you&#8217;re in there.</p>
<p><strong>Get some REST</strong></p>
<p>To be honest, RESTful testing is one of the less-complex cases we get requests for.  It&#8217;s typically a black-box request from the client to a service, one illustrated by <a href="https://github.com/arquillian/arquillian-showcase/blob/master/jaxrs/src/test/java/com/acme/jaxrs/CustomerResourceClientTest.java" target="_blank">this example</a> from the Arquillian Showcase.</p>
<p>The magic bit is knowing exactly what URL to hit, as the host or context path shouldn&#8217;t really be hardcoded.  Arquillian helps us out here:</p>
<pre>@ArquillianResource
URL deploymentUrl;</pre>
<p>&#8230;and from there it&#8217;s business as usual, though the RESTEasy Client APIs make this even simpler for us than a standard HTTP client:</p>
<pre>ClientRequest request = new ClientRequest(deploymentUrl.toString() + RESOURCE_PREFIX + "/customer/1");
request.header("Accept", MediaType.APPLICATION_XML);

// we're expecting a String back
ClientResponse responseObj = request.get(String.class);

Assert.assertEquals(200, responseObj.getStatus());
System.out.println("GET /customer/1 HTTP/1.1\n\n" + responseObj.getEntity());

String response = responseObj.getEntity().replaceAll("&lt;\\?xml.*\\?&gt;", "").trim();
Assert.assertEquals("1Acme Corporation", response);</pre>
<p><strong>Wrap-up</strong></p>
<p>Again, this presentation is more fun when it&#8217;s interactive.  There&#8217;s definitely more than one way to skin a cat, and we&#8217;re open to hearing your suggestions, solutions, and pain points.  It&#8217;s likely that some ideas you&#8217;ve got could make it into the book, so we&#8217;re excited to see and hear from you, either in person at the session or here in the comments.</p>
<p>S,</p>
<p><a href="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif"><img class="alignnone size-full wp-image-167" title="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640" alt=""   /></a></p>
<p>ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/344/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=344&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2012/10/03/con5312/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
		<item>
		<title>Today&#8217;s Rapid Java EE Development: Live Coding from Scratch to Deployment</title>
		<link>http://exitcondition.alrubinger.com/2012/10/01/con5458/</link>
		<comments>http://exitcondition.alrubinger.com/2012/10/01/con5458/#comments</comments>
		<pubDate>Mon, 01 Oct 2012 12:49:34 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/?p=314</guid>
		<description><![CDATA[Aslak and I are happy to be kicking off JavaOne 2012 here in San Francisco, and this entry is to detail (and accompany) the talk we&#8217;ll soon be giving on Monday morning, 1st October, at 8:30AM Pacific Time at the Parc55 Hotel in Cyril Magnin II/III. Because not everyone can be joining us in person, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=314&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="https://twitter.com/aslakknutsen" target="_blank">Aslak</a> and I are happy to be kicking off JavaOne 2012 here in San Francisco, and this entry is to detail (and accompany) the talk we&#8217;ll soon be giving on Monday morning, 1st October, at 8:30AM Pacific Time at the Parc55 Hotel in Cyril Magnin II/III.</p>
<p>Because not everyone can be joining us in person, and because this is a technical talk we&#8217;d like to better enable our attendees to follow, this entry should serve as a guide for the live coding and demos we&#8217;ll be covering.  Session details may be found via the <a href="https://oracleus.activeevents.com/connect/sessionDetail.ww?SESSION_ID=5458" target="_blank">JavaOne</a> site and on <a href="http://lanyrd.com/2012/javaone/sxgcb/" target="_blank">Lanyrd</a>.</p>
<p>The abstract reads:</p>
<blockquote><p>The myth of Java EE as a cumbersome platform is easily dispelled in this session, which aims to create a working application, from a blank repository to a live cloud deployment, in real time. It:</p>
<p>• Covers tools that bootstrap project creation, freeing you from mucking around with Maven POM boilerplate<br />
* Generates a domain model and reverse-engineers JPA entities from it<br />
* Automatically creates the scaffolding for tests that run in a real Java EE container, launched from the IDE<br />
* Pushes it all to production on a public site</p>
<p>Using a variety of projects from the JBoss Community adhering to and building upon open standards, this presentation can create real enterprise apps in the time it takes other sessions to click through some slides. Let’s get building!</p></blockquote>
<p>Presentation (intentionally-minimal) slides are available <a href="http://www.rvl.io/alrubinger/javaone-2012-con5458" target="_blank">here</a>, and I&#8217;ve posted some scripts and other human-readable instructions on <a href="https://github.com/ALRubinger/presentations/tree/master/2012/201210-JavaOne_SanFrancisco/CON5458" target="_blank">GitHub</a>.  The content we cover today is more or less adapted from an early chapter of the upcoming <a href="http://continuousdev.org">Continuous Enterprise Development in Java</a>, now in Early Access Release and available for pre-sale.</p>
<p>The name of the game here is to take a blank repository (or filesystem), make a minimal, but fully-functioning data-based project, and get it online for the world to use before the JavaOne guys at the back of the room cut off our microphones.  Given the typical unreliability of conference network connections, we&#8217;ll pray extra hard to the Demo Gods that all goes smoothly.</p>
<p>Here we go.</p>
<p>I&#8217;ll be the first to admit that I&#8217;ve never much been a &#8220;tools&#8221; guy.  Sure, I use an IDE, but until recently I never saw much need to even dig too deeply into its featureset or gather many extra Plugins.  I used to catch Ruby on Rails demonstrations build an app from scratch and was typically left as one of the dissenters in the audience who believed that an application which directly mirrored the CRUD operations of a domain model was essentially worthless.  I&#8217;m well-versed in Maven configuration and can copy XML with the best of them, so that&#8217;s primarily how I&#8217;ve been coding my projects.</p>
<p>And I continue to believe in Java EE as a component model, especially as we&#8217;ve seen the Platform get less verbose and implementations break new ground in speed and efficiency.  Over the past few years we continually get feedback that figuring out exactly how to piece all the EE techs together into a cohesive application is difficult; documentation is scattered and may vary heavily from vendor to vendor.  At JBoss we&#8217;ve been working hard the past year or so on initiatives to address this very problem.</p>
<p>The first steps in setting up a new project are to lay out the structure, define the required dependencies, and get a working build in place.  As has become widely-accepted, I&#8217;ve been filling these via <a href="http://maven.apache.org/">Maven</a> for the past several years, and the process typically involves heavy use of copying an existing project, searching Google for relevant XML snippits, and wading through the Maven Central Repository index to find the coordinates of  whatever libraries you&#8217;ll depend upon.  Let&#8217;s see if we can take a different tack now.</p>
<div class="wp-caption alignnone" style="width: 610px"><a href="http://forge.jboss.org/"><img title="JBoss Forge" src="http://i.imgur.com/BNzSJ.png" alt="JBoss Forge" width="600" height="244" /></a><p class="wp-caption-text">JBoss Forge</p></div>
<p>Forge is an incremental project construction tool, and it&#8217;s implemented as a handy shell.  Through it, we can set up a Maven POM, quickly stub out our domain layer, reverse-engineer view components, get a head start on our test cases, manage servers and deployments, and much more through its extensible API.  This becomes especially handy for scripting.  Additionally, it&#8217;s well-integrated into:</p>
<p><a href="https://devstudio.jboss.com/download/"><img class="alignnone size-medium wp-image-322" title="JBoss Developer Studio" src="http://exitcondition.files.wordpress.com/2012/10/jbds.png?w=300&#038;h=194" alt="JBoss Developer Studio" width="300" height="194" /></a></p>
<p>&#8230;JBoss Developer Studio, an integrated set of plugins atop the Eclipse Platform geared towards Java EE, and specifically, JBoss project development.</p>
<p>Once we fire up JBDS, we&#8217;re set with an empty slate.  By invoking the Forge shell within the IDE (Control-4), we&#8217;re met with a prompt ready to take our input.  From here we can start to put our project together.  Each action we take will be automatically reflected in the Project Explorer.  For this application, we&#8217;ll execute the following Forge commands:</p>
<pre>new-project --named feedback --topLevelPackage org.cedj.javaone2012.feedback --projectFolder feedback;</pre>
<p>That&#8217;ll make us a new project. Now we&#8217;ll enable JPA and Bean Validation:</p>
<pre>persistence setup --provider HIBERNATE --container JBOSS_AS7
validation setup --provider HIBERNATE_VALIDATOR</pre>
<p>With that behind us, we can create some Entities and set their properties and constraints:</p>
<pre>entity --named FeedbackEntry
field string --named twitterHandle
constraint NotNull --onProperty twitterHandle
field string --named feedback
constraint NotNull --onProperty feedback</pre>
<p>We&#8217;ll also let Forge generate some JSF View pages for us to play with later.</p>
<pre>scaffold setup
scaffold from-entity org.cedj.javaone2012.feedback.model.*</pre>
<p>Those who have been following this space should be aware of my involvement with the <a href="http://arquillian.org" target="_blank">Arquillian</a> Test Platform, so it&#8217;ll probably come as no surprise that I&#8217;d be interested in setting up the POM with Arquillian dependencies (to be executed against JBossAS7) and generating a test case upon which to build:</p>
<pre>forge install-plugin arquillian
arquillian setup --container JBOSS_AS_REMOTE_7.X
arquillian create-test --class org.cedj.javaone2012.feedback.model.FeedbackEntry.java</pre>
<p>Before we continue, let&#8217;s change the default in <code>persistence.xml</code> to allow us to preserve data between deployments:</p>
<pre>&lt;property name="hibernate.hbm2ddl.auto" value="update"/&gt;</pre>
<p>We&#8217;re now ready to build our application; Forge can execute the Maven lifecycle for us:</p>
<pre>build --notest --profile JBOSS_AS_REMOTE_7.X;</pre>
<p>We may also equip Forge and our project with the ability to interact with the application server:</p>
<pre>forge install-plugin jboss-as-7
as7 setup
as7 start
as7 deploy</pre>
<p>Assuming all went to plan, our application should be available in the browser at <code><a href="http://localhost:8080/feedback" rel="nofollow">http://localhost:8080/feedback</a></code>. Let&#8217;s put some data into our application for us to test. Pick whatever values tickle you and save them through the web interface.</p>
<p>When done, we can undeploy the application from the app server:</p>
<pre>as7 undeploy</pre>
<p>Now let&#8217;s change our generated <code>FeedbackEntryTest</code> to something more reasonable. Something like this:</p>
<pre>@RunWith(Arquillian.class)
public class FeedbackEntryTest {
	@PersistenceContext
	private EntityManager em;

	@Deployment
	public static WebArchive createDeployment() {
		return ShrinkWrap.createFromZipFile(WebArchive.class, new File(
				"target/feedback.war"));
	}

	@Test
	public void canFindFeedbackByUser() {
		final FeedbackEntry feedback = em.createQuery(
				"from " + FeedbackEntry.class.getSimpleName()
						+ " where twitterHandle='@ALRubinger'",
				FeedbackEntry.class).getSingleResult();
		Assert.assertNotNull(feedback);
	}

	@Test
	public void testIsDeployed() {
		Assert.assertNotNull(em);
	}
}</pre>
<p>This will deploy our application into the running server and ensure that we may find a user by the specified Twitter handle. If you&#8217;ve populated the database via the web interface above and are looking for the right handle in &#8220;canFindFeedbackByUser&#8221;, this should pass when executed from the IDE in &#8220;Run As &gt; JUnit&#8221;.</p>
<p>So we&#8217;re managed to set up a minimal application, run it, and test it locally.  In the spirit of &#8220;release early, release often&#8221;, might as well make this public.</p>
<p><a href="http://openshift.com"><img class="alignnone size-medium wp-image-335" title="OpenShift" src="http://exitcondition.files.wordpress.com/2012/10/openshift.png?w=300&#038;h=300" alt="OpenShift" width="300" height="300" /></a></p>
<p><a href="http://openshift.com" target="_blank">OpenShift</a> is the Cloud-based PaaS offering from Red Hat.  It&#8217;s free to sign up, and provides hosting for a series of applications, Java EE apps on JBossAS7 included.</p>
<p>Once signed up, it&#8217;s easy to create a Domain in the JBoss Developer Studio &#8220;OpenShift Explorer&#8221;.  From there, &#8220;Create New Application&#8230;&#8221;</p>
<p><a href="http://exitcondition.files.wordpress.com/2012/10/openshift_login1.png"><img class="alignnone size-full wp-image-337" title="openshift_login" src="http://exitcondition.files.wordpress.com/2012/10/openshift_login1.png?w=640" alt=""   /></a></p>
<p>After logging in, you may set up the new JBossAS7 application on OpenShift via the IDE:</p>
<p><a href="http://exitcondition.files.wordpress.com/2012/10/openshift_new_app.png"><img class="alignnone size-full wp-image-338" title="openshift_new_app" src="http://exitcondition.files.wordpress.com/2012/10/openshift_new_app.png?w=640" alt=""   /></a></p>
<p>Once the new OpenShift Application is made, link it to the existing project in your workspace:</p>
<p><a href="http://exitcondition.files.wordpress.com/2012/10/openshift_use_existing.png"><img class="alignnone size-full wp-image-339" title="openshift_use_existing" src="http://exitcondition.files.wordpress.com/2012/10/openshift_use_existing.png?w=640&#038;h=352" alt="" width="640" height="352" /></a></p>
<p>You&#8217;ll be asked if you&#8217;d like to connect your project to the OpenShift application&#8217;s Git settings (this is the version control system which backs the OpenShift deployment mechanism).  Agree.</p>
<p><a href="http://exitcondition.files.wordpress.com/2012/10/openshift_connect.png"><img class="alignnone size-full wp-image-340" title="openshift_connect" src="http://exitcondition.files.wordpress.com/2012/10/openshift_connect.png?w=640" alt=""   /></a></p>
<p>Once your server is set up, you can find it in the &#8220;Servers&#8221; tab.  Right-clicking your application under the server will afford you the opportunity to &#8220;Publish&#8221;.</p>
<p>Do it.</p>
<p>After some pause while OpenShift uploads your application, builds it remotely, and deploys it, you&#8217;ll be able to open via the browser and share the link with the world.</p>
<p>With any luck, things will go just this smoothly at JavaOne. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>S,</p>
<p><a href="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif"><img class="alignnone size-full wp-image-167" title="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640" alt=""   /></a></p>
<p>ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/314/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=314&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2012/10/01/con5458/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://i.imgur.com/BNzSJ.png" medium="image">
			<media:title type="html">JBoss Forge</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/10/jbds.png?w=300" medium="image">
			<media:title type="html">JBoss Developer Studio</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/10/openshift.png?w=300" medium="image">
			<media:title type="html">OpenShift</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/10/openshift_login1.png" medium="image">
			<media:title type="html">openshift_login</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/10/openshift_new_app.png" medium="image">
			<media:title type="html">openshift_new_app</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/10/openshift_use_existing.png" medium="image">
			<media:title type="html">openshift_use_existing</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/10/openshift_connect.png" medium="image">
			<media:title type="html">openshift_connect</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
		<item>
		<title>Integration-Testing Nontrivial Deployments: A Sane Maven Dependency Resolver</title>
		<link>http://exitcondition.alrubinger.com/2012/09/13/shrinkwrap-resolver-new-api/</link>
		<comments>http://exitcondition.alrubinger.com/2012/09/13/shrinkwrap-resolver-new-api/#comments</comments>
		<pubDate>Thu, 13 Sep 2012 06:19:32 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/?p=293</guid>
		<description><![CDATA[The use case which lead to the birth of the ShrinkWrap project may be summed up: identify deployments for simplified integration testing. So we built an API which made it easy to group resources together in a single deployable unit: JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "deployment.jar") .addClass(MyEjb.class, MyCdiBean.class); Combined with the Arquillian Test Platform which deploys [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=293&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The use case which lead to the birth of the <a href="http://arquillian.org/guides/shrinkwrap_introduction/" target="_blank">ShrinkWrap</a> project may be summed up: identify deployments for simplified integration testing.</p>
<p>So we built an API which made it easy to group resources together in a single deployable unit:</p>
<pre>JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "deployment.jar")
   .addClass(MyEjb.class, MyCdiBean.class);</pre>
<p>Combined with the <a href="http://arquillian.org/guides/getting_started/" target="_blank">Arquillian</a> Test Platform which deploys objects like the above into Application Servers, Servlet Containers, and IoC Containers, the result is a full integration test which writes and executes like a unit test.  This is the heart of the Arquillian component model.</p>
<p>ShrinkWrap excels at filing byte-based content into a tree structure; that&#8217;s all a virtual filesystem does (or should do!).  But for a long while now there&#8217;s been a divide which has made testing more complex deployments difficult: you might not always have the content you want to insert on-hand.  Consider the following use cases:</p>
<ol>
<li>A CDI bean which has library dependencies on a 3rd-party project</li>
<li>An EAR module which is composed of a few JARs, WARs, etc. which are built by other projects.</li>
<li>Module A depends on Module B, and you want to easily test the development versions (ie. unreleased) without changing your test code to match</li>
</ol>
<p>The problem we have here is that once you start calling out to code that&#8217;s not in your project, you need to incorporate <em> dependencies</em> into your deployments.  And finding these dependencies is a nontrivial problem to solve:</p>
<ul>
<li>Not every developer will be keeping a dependency repository in the same place on her machine</li>
<li>Versions change as development progresses</li>
<li>If you&#8217;re testing as part of your build, and your test relies upon a build output (like a JAR), you&#8217;ve got a cyclic dependency</li>
</ul>
<p>This gap is the number one <a href="http://www.jroller.com/robwilliams/entry/arquillian_stopping_for_now" target="_blank">complaint</a> we get in the Arquillian Community, and I&#8217;ve been happy to take the blame from the ShrinkWrap side because I&#8217;ve refused to offer up stopgap solutions.  I don&#8217;t like software that guesses, and I especially don&#8217;t like it when software guesses incorrectly.  Behaviour should be clear, concise, and deterministic.</p>
<p>So what we have really is two different problems: First, getting dependency content into a ShrinkWrap archive.  That&#8217;s easy.  The harder part is in <em>resolving</em> the dependencies from some coordinates which make sense to put into a test.</p>
<p>Perhaps the biggest asset made available by the <a href="http://maven.apache.org/" target="_blank">Maven</a> community is its expansive <a href="http://search.maven.org/" target="_blank">Central</a> repository.  Regardless of the build tool you&#8217;re using, this repo makes  libraries available under a <a href="http://maven.apache.org/pom.html#Maven_Coordinates" target="_blank">coordinate system</a> which acts as a unique address (per repository).</p>
<p>Additionally, the <a href="http://www.sonatype.com/people/2010/08/introducing-aether/" target="_blank">Aether</a> project, used by the Maven backend, is a standalone dependency resolver.  Unfortunately, the Aether API isn&#8217;t really built to handle the kinds of slimmer-code aims we espouse in the Arquillian community.</p>
<p>Perhaps no one is aware of the warts in testing enterprise software better than the JBoss Quality Engineering team in Brno, and our own <a href="https://twitter.com/karelpiwko" target="_blank">Karel Piwko</a> last year started prototyping an adaptor between ShrinkWrap and the Aether backend.  What he built worked, and over the next several months we got a handle on exactly how users were hoping to pull dependencies into their deployments.  We&#8217;re now happy with the API and seeking more input to refine it before it locks as backwards-compatible, so:</p>
<p>Tonight we&#8217;d like to officially announce ShrinkWrap Resolvers (SWR), 2.0.0-alpha-2.</p>
<pre>org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-depchain:2.0.0-alpha-2:pom</pre>
<p>The base has no compile-time dependencies (though you&#8217;ll need a bunch at runtime), and is capable of resolving to Files, InputStreams, or a custom type if you&#8217;d like to provide your own <code>FormatProcessor</code>.</p>
<p>The syntax follows generally the form:</p>
<blockquote><p><em>Resolve</em> [this coordinate set] <em>using</em> [some resolution strategy] <em>formatted as</em> [a type]</p></blockquote>
<p>Its use looks like:</p>
<pre>File junit = Maven.resolver().resolve("junit:junit:4.10")
   .withoutTransitivity().asSingle(File.class);</pre>
<p>It&#8217;s also easy to pull in transitive dependencies associated with a coordinate:</p>
<pre>File[] dependencyAndTransitives = Maven.resolver().resolve("groupId:artifactId:version")
   .withTransitivity().as(File.class);</pre>
<p>Often we need to run resolution using alternate repositories or project-specific configuration.  In that case:</p>
<pre>Maven.configureResolver().fromClassloaderResource("settings.xml")
   .resolve("groupId:artifactId:version").withoutTransitivity().as(File.class);</pre>
<p>When we need to test the <strong>current</strong> version of the software we&#8217;re building, we might want to take advantage of all the <code>dependencyManagement</code> settings in our POM such that we don&#8217;t have to manually specify the version.  In that case:</p>
<pre>Maven.resolver().loadPomFromFile("pom.xml").resolve("groupId:artifactId")
   .withoutTransitivity().as(File.class);</pre>
<p>And perhaps we just want to get <strong>everything</strong> the current POM has defined as a dependency, with correct versions:</p>
<pre>Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies()
   .as(File.class)</pre>
<p>We&#8217;re offering a separate &#8220;ShrinkWrap Archive&#8221; extension to SWR, enabling direct resolution to an archive:</p>
<pre>JavaArchive jar = ShrinkWrapMaven.resolver().resolve("groupId:artifactId:version")
   .withoutTransitivity().asSingle(JavaArchive.class);</pre>
<p>SWR also supports offline mode, and integration with a Plugin enables the developer to skip explicitly setting the <code>settings.xml</code> or <code>pom.xml</code> file.</p>
<p>Over the next few alpha-level releases we&#8217;ll work on validating that the API makes sense, building up documentation, and porting in more essential features.  As always, we&#8217;d love you to get involved in <a href="https://github.com/shrinkwrap/resolver" target="_blank">development</a> or offer us your experience through <a href="https://issues.jboss.org/browse/SHRINKRES" target="_blank">feature requests and bug reports</a>.</p>
<p>S,</p>
<p><a href="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif"><img class="alignnone size-full wp-image-167" title="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640" alt=""   /></a></p>
<p>ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/293/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=293&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2012/09/13/shrinkwrap-resolver-new-api/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing an In-Memory File System for Java: ShrinkWrap NIO.2</title>
		<link>http://exitcondition.alrubinger.com/2012/08/17/shrinkwrap-nio2/</link>
		<comments>http://exitcondition.alrubinger.com/2012/08/17/shrinkwrap-nio2/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 11:09:37 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/?p=278</guid>
		<description><![CDATA[We&#8217;d initially built ShrinkWrap as virtual filesystem which would simplify the declaration of deployable archives for a Java Enterprise environment.  It&#8217;s mostly been successful for two reasons: The API is clean, concise, and intuitive The backend adaptors allow us to translate the ShrinkWrap grammars into something Java EE containers can understand Though the project has [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=278&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>We&#8217;d initially built <a href="http://arquillian.org/guides/shrinkwrap_introduction/" target="_blank">ShrinkWrap</a> as virtual filesystem which would simplify the declaration of deployable archives for a Java Enterprise environment.  It&#8217;s mostly been successful for two reasons:</p>
<ol>
<li>The API is clean, concise, and intuitive</li>
<li>The backend adaptors allow us to translate the ShrinkWrap grammars into something Java EE containers can understand</li>
</ol>
<p><img class="alignnone" title="ShrinkWrap" src="http://design.jboss.org/shrinkwrap/logo/images/shrinkwrap_logo_450px.gif" alt="" width="450" height="100" /></p>
<p>Though the project has never had any EE dependencies, its most famous application has always been as the deployment mechanism for the <a href="http://arquillian.org/" target="_blank">Arquillian Test Platform</a>.  Today I can announce that ShrinkWrap is officially equipped with its first SE-targeted feature as backend provider of an in-memory Java7 FileSystem.</p>
<p>Creation of the FileSystem through the NIO.2 API looks like this:</p>
<pre>final JavaArchive archive = ShrinkWrap.create(JavaArchive.class,"myArchive.jar");
final Map&lt;String, JavaArchive&gt; environment = new HashMap&lt;&gt;();
environment.put(ShrinkWrapFileSystems.FS_ENV_KEY_ARCHIVE, archive);
final URI uri = ShrinkWrapFileSystems.getRootUri(archive);
final FileSystem fileSystem = FileSystems.newFileSystem(uri, environment);</pre>
<p>And of course we offer a shortcut API:</p>
<pre>final JavaArchive archive = ShrinkWrap.create(JavaArchive.class);
final FileSystem fileSystem = ShrinkWrapFileSystems.newFileSystem(archive);</pre>
<p>From there, simply interact with ShrinkWrap through the NIO.2 classes just as you would with the default filesystem; lots of operations are made easy by the new <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html" target="_blank">Files</a> API.</p>
<p>The magic piece backing all I/O is our new implementation of <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/channels/SeekableByteChannel.html" target="_blank">SeekableByteChannel</a>.  This interface defines operations for random access to an in-memory byte store in  both read and write modes, and our implementation is available for use <a href="https://github.com/shrinkwrap/shrinkwrap/blob/master/api-nio2/src/main/java/org/jboss/shrinkwrap/api/nio/file/SeekableInMemoryByteChannel.java" target="_blank">standalone</a>.</p>
<p>In addition, we compose this support together with the ability to be directly added to an archive via <a href="https://github.com/shrinkwrap/shrinkwrap/blob/master/api-nio2/src/main/java/org/jboss/shrinkwrap/api/nio/file/MemoryAsset.java" target="_blank">MemoryAsset</a> and <a href="https://github.com/shrinkwrap/shrinkwrap/blob/master/api-nio2/src/main/java/org/jboss/shrinkwrap/api/nio/file/MemoryNamedAsset.java" target="_blank">MemoryNamedAsset</a>.</p>
<p>ShrinkWrap Core remains free of dependencies.  While the base implementation runs on Java5, this new support does require Java7.  To this end, we&#8217;ve provided a new <a href="https://github.com/shrinkwrap/shrinkwrap/blob/master/depchain-java7/pom.xml" target="_blank">Dependency Chain POM</a> to bring in this support without imposing Java7 on all users.</p>
<p>ShrinkWrap NIO.2 is available in versions starting at 1.1.0-alpha-4, now available from <a href="http://search.maven.org/#artifactdetails%7Corg.jboss.shrinkwrap%7Cshrinkwrap-depchain-java7%7C1.1.0-alpha-4%7Cpom" target="_blank">Maven Central</a>.</p>
<p>S,</p>
<p><a href="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif"><img class="alignnone size-full wp-image-167" title="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640" alt=""   /></a></p>
<p>ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=278&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2012/08/17/shrinkwrap-nio2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://design.jboss.org/shrinkwrap/logo/images/shrinkwrap_logo_450px.gif" medium="image">
			<media:title type="html">ShrinkWrap</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
		<item>
		<title>Continuous Enterprise Development in Java</title>
		<link>http://exitcondition.alrubinger.com/2012/07/05/continuous-enterprise-development-in-java/</link>
		<comments>http://exitcondition.alrubinger.com/2012/07/05/continuous-enterprise-development-in-java/#comments</comments>
		<pubDate>Fri, 06 Jul 2012 02:43:05 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/?p=257</guid>
		<description><![CDATA[A welcome consequence of working in open-source is that we&#8217;re tightly wound into the user feedback loop; over time the shortcomings of our projects and industry echo repeatedly and steer our direction. It&#8217;s become very clear to us on the Arquillian team that users aren&#8217;t really seeking a component-by-component approach to building applications.  While docs [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=257&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A welcome consequence of working in open-source is that we&#8217;re tightly wound into the user feedback loop; over time the shortcomings of our projects and industry echo repeatedly and steer our direction.</p>
<p>It&#8217;s become very clear to us on the Arquillian team that users aren&#8217;t really seeking a component-by-component approach to building applications.  While docs on EJB and Seam are all well and good, they&#8217;re instructive of a particular technology.  And users don&#8217;t primarily aim to learn APIs, they want to <em>solve problems</em>.</p>
<ul>
<li><strong>How</strong> do I bootstrap my application tests with data?</li>
<li><strong>What&#8217;s</strong> a good approach to handling server-push events?</li>
<li><strong>Where</strong> is the best place to keep my logged-in user&#8217;s state?</li>
<li><strong>When</strong> is it appropriate to leverage a distributed data grid?</li>
<li><strong>Why</strong> would I opt for a NoSQL solution in place of a relational model?</li>
</ul>
<p>For a long time now we&#8217;ve debated undertaking an &#8220;Arquillian Book&#8221; to showcase our beloved test platform.  But as the idea to author a text evolved, our own advice increased in relevance:</p>
<blockquote><p>Testing <em>is</em> development.</p></blockquote>
<p>Arquillian isn&#8217;t really the focus; it&#8217;s just a tool.  And under the JBoss umbrella, we have a veritable armada of projects suited to ease, extend, and enhance Enterprise Java.</p>
<p>What&#8217;s been lacking is a illustrative source to address how these disparate bits work in tandem, and more importantly, when they should be applied.</p>
<p>So I&#8217;m proud to announce that <a href="https://twitter.com/#!/mojavelinux" target="_blank">Dan Allen</a>, <a href="https://twitter.com/#!/aslakknutsen" target="_blank">Aslak Knutsen</a> and I will be delivering a guide to some of the most common and interesting use-cases in building multiuser applications.  It&#8217;s aptly entitled: &#8220;<em>Continuous Enterprise Development in Java</em>&#8220;.</p>
<p>The book is currently on-target for an Early-Access Program, presales, and some initial material to be available around the <a href="http://www.oracle.com/javaone/index.html">JavaOne 2012</a> timeframe, with formal release following in the Spring of 2013.</p>
<p>We&#8217;ve enlisted the editorial expertise of O&#8217;Reilly Media, and in particular Meghan Blanchette to assist with quality assurance, translations, electronic media, and worldwide distribution.</p>
<p><a href="http://oreilly.com/"><img class="alignnone size-full wp-image-260" title="O'Reilly Media" src="http://exitcondition.files.wordpress.com/2012/07/oreilly.png?w=640" alt=""   /></a></p>
<p>The decision to go with O&#8217;Reilly was two-fold.</p>
<ol>
<li>Trust.  Meghan made it clear that she&#8217;d mediate on our behalf to address some rather non-traditional requests for the authoring and publication process.</li>
<li>O&#8217;Reilly catered to our needs and enabled us with the open process we&#8217;d been hoping for.</li>
</ol>
<p>At a time when half the world has gone mad over intellectual property and copyrights in a vain effort to &#8220;protect&#8221; their work, Tim O&#8217;Reilly has advocated for the &#8220;<a href="http://www.techdirt.com/articles/20120116/10031617417/tim-oreilly-explains-where-federal-govt-has-gone-wrong-sopapipa-solving-wrong-problem.shtml">free flow of information</a>&#8220;.  As developers of free software, we agree and will be authoring the book&#8217;s source content under the <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Sharealike License</a>.</p>
<p><a href="http://creativecommons.org/licenses/by-sa/3.0/"><img class="alignnone size-full wp-image-263" title="cc" src="http://exitcondition.files.wordpress.com/2012/07/cc.png?w=640" alt=""   /></a></p>
<p>This enables us to hook into a complementary effort already underway at JBoss: <a href="http://www.jboss.org/developer" target="_blank">The JBoss Way</a>.</p>
<p><a href="http://www.jboss.org/developer"><img class="alignnone size-full wp-image-264" title="The JBoss Way" src="http://exitcondition.files.wordpress.com/2012/07/jbossway.png?w=640" alt=""   /></a></p>
<p>Put simply, the JBoss Way is an approach to building Java EE applications using the JBoss stack.  It&#8217;s backed by a series of quickstart examples and tutorials branded as the <a href="http://www.jboss.org/jdf">JBoss Developer Framework</a>.</p>
<p><a href="http://www.jboss.org/jdf"><img class="alignnone size-medium wp-image-267" title="JBoss Developer Framework" src="http://exitcondition.files.wordpress.com/2012/07/jdf_logo_450px.png?w=300&#038;h=100" alt="" width="300" height="100" /></a></p>
<p>The JDF team has been doing some great work that&#8217;s available NOW to use/view/fork.  The <a href="http://ticketmonster-jdf.rhcloud.com/" target="_blank">TicketMonster</a> example is already running on the <a href="https://openshift.redhat.com/app/" target="_blank">OpenShift</a> cloud.</p>
<p>So Dan, Aslak and I are very, very excited to pursue this open approach to publishing along with our friends in the Java EE Community, for the Java EE Community.</p>
<p>S,</p>
<p><img class="alignnone size-full wp-image-167" title="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640" alt=""   /></p>
<p>ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=257&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2012/07/05/continuous-enterprise-development-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/07/oreilly.png" medium="image">
			<media:title type="html">O&#039;Reilly Media</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/07/cc.png" medium="image">
			<media:title type="html">cc</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/07/jbossway.png" medium="image">
			<media:title type="html">The JBoss Way</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/07/jdf_logo_450px.png?w=300" medium="image">
			<media:title type="html">JBoss Developer Framework</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
		<item>
		<title>The Unofficial JBoss Drinkup and JUDCon / JBossWorld Kickoff</title>
		<link>http://exitcondition.alrubinger.com/2012/06/22/judcon2012drinkup/</link>
		<comments>http://exitcondition.alrubinger.com/2012/06/22/judcon2012drinkup/#comments</comments>
		<pubDate>Fri, 22 Jun 2012 21:09:39 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/?p=251</guid>
		<description><![CDATA[JUDCon and JBossWorld Boston 2012 are upon us, folks. This year we&#8217;ll be having an informal, unofficial meetup at the oldest continually operating tavern in the United States, the Bell in Hand. 45 Union Street Boston MA 02108 (617) 227-2098 We&#8217;ll be there 6PM &#8211; 9PM on Sunday night, the 24th of June, the night [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=251&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>JUDCon and JBossWorld Boston 2012 are upon us, folks.</p>
<p><a href="http://exitcondition.files.wordpress.com/2012/06/judcon2012_boston_logo_color_lightbkg.png"><img class="alignnone size-full wp-image-252" title="JUDCon 2012" src="http://exitcondition.files.wordpress.com/2012/06/judcon2012_boston_logo_color_lightbkg.png?w=640" alt=""   /></a></p>
<p>This year we&#8217;ll be having an informal, unofficial meetup at the oldest continually operating tavern in the United States, the <a href="http://bellinhand.com/homepage" target="_blank">Bell in Hand</a>.</p>
<p><a href="http://exitcondition.files.wordpress.com/2012/06/bell_in_hand_tavern.gif"><img class="alignnone size-full wp-image-253" title="Bell in Hand Tavern" src="http://exitcondition.files.wordpress.com/2012/06/bell_in_hand_tavern.gif?w=640" alt=""   /></a></p>
<p>45 Union Street<br />
Boston MA 02108<br />
(617) 227-2098</p>
<p>We&#8217;ll be there 6PM &#8211; 9PM on Sunday night, the 24th of June, the night before JUDCon.</p>
<p>Take note of the <a href="http://goo.gl/maps/PB1R" target="_blank">driving</a> or <a href="http://goo.gl/maps/Efdg" target="_blank">public transit</a> directions (relative to the Hynes Convention Center), and be sure to join up!</p>
<p>Lost?  Ping me on Twitter <a href="https://twitter.com/#!/ALRubinger" target="_blank">@ALRubinger</a> and I&#8217;ll do my best to guide you.</p>
<p>S,</p>
<p><a href="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif"><img class="alignnone size-full wp-image-167" title="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640" alt=""   /></a></p>
<p>ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/251/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=251&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2012/06/22/judcon2012drinkup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/06/judcon2012_boston_logo_color_lightbkg.png" medium="image">
			<media:title type="html">JUDCon 2012</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/06/bell_in_hand_tavern.gif" medium="image">
			<media:title type="html">Bell in Hand Tavern</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
		<item>
		<title>Call for Collaboration: JavaOne 2012 Community Keynote</title>
		<link>http://exitcondition.alrubinger.com/2012/03/22/call-for-collaboration-javaone-2012-community-keynote/</link>
		<comments>http://exitcondition.alrubinger.com/2012/03/22/call-for-collaboration-javaone-2012-community-keynote/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 06:59:59 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/2012/03/22/call-for-collaboration-javaone-2012-community-keynote/</guid>
		<description><![CDATA[In the Arquillian Team, we believe that Open Source isn&#8217;t really about software; it&#8217;s about the exchange of ideas.  Across cultures, corporations, locales we come together each armed with a slightly different perspective.  Slightly different strengths.  Lately we&#8217;ve been grateful to field pull requests for code, documentation translations, new ideas, community roadmap planning meetings, and criticisms alike. [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=246&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In the <a href="http://www.jboss.org/arquillian">Arquillian</a> Team, we believe that Open Source isn&#8217;t really about software; it&#8217;s about the exchange of ideas.  Across cultures, corporations, locales we come together each armed with a slightly different perspective.  Slightly different strengths.  Lately we&#8217;ve been grateful to field pull requests for code, documentation translations, new ideas, community roadmap planning meetings, and criticisms alike.</p>
<p><a href="http://design.jboss.org/arquillian/logo/final/arquillian_logo_200px.png"><img src="http://design.jboss.org/arquillian/logo/final/arquillian_logo_200px.png" alt="http://design.jboss.org/arquillian/logo/final/arquillian_logo_200px.png" /></a></p>
<p>And just as Open Source isn&#8217;t restricted to programming, Arquillian isn&#8217;t bound to Java EE.  Sure, its roots have been in the testability of app servers, but the Platform has grown to reach the UI.  Persistence.  Stress-testing.</p>
<p>Because the mission of Arquillian is to get you testing inside of your real environment.  No mocks.  And to us, testing is development.</p>
<p>This year, we want to take the Platform deeper into the Java ecosystem.  We want to see exactly how easy we can make the testable development cycle for more technologies: JavaFX.  Android.  Eclipse development.  Other VM languages.  Whatever you bring to the table.</p>
<p>So in true Open fashion, we&#8217;d like to extend an invitation to all developers and speakers within the Java landscape to join us in a submission for the <a href="http://openj.dk/2012/03/14/javaone-community-keynote-cfp/">JavaOne 2012 Community Keynote</a> this October in San Francisco.</p>
<p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/38-4896-18249/javaone_lg.jpg"><img src="https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4896-18249/238-78/javaone_lg.jpg" alt="javaone_lg.jpg" width="238" height="78" /></a></p>
<p>The focus of the proposed talk will be testable development of as many Java corners as we can represent, and the Arquillian team will assist with integration as we can.  We&#8217;ll have a few months to arrange examples and show the in-IDE testing of components that were previously unwieldy or cumbersome.</p>
<p><a href="http://exitcondition.files.wordpress.com/2012/03/arq_pres.png"><img class="alignnone size-full wp-image-248" title="arq_pres" src="http://exitcondition.files.wordpress.com/2012/03/arq_pres.png?w=640" alt=""   /></a></p>
<p>Of course, we can make no guarantees that our proposed talk will pass the selection committee, but we feel that the Open nature of this submission speaks to the true Community spirit of the Keynote.</p>
<p>So join us in our run for the Big Stage; leave comments in the Thread below and we&#8217;ll kick off a group to together outline the proposal and submit it for consideration by the due date, 9 April.</p>
<p>S,</p>
<p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/38-4896-18250/alr_signature.gif"><img src="https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4896-18250/202-69/alr_signature.gif" alt="alr_signature.gif" width="202" height="69" /></a></p>
<p>ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/246/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=246&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2012/03/22/call-for-collaboration-javaone-2012-community-keynote/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://design.jboss.org/arquillian/logo/final/arquillian_logo_200px.png" medium="image">
			<media:title type="html">http://design.jboss.org/arquillian/logo/final/arquillian_logo_200px.png</media:title>
		</media:content>

		<media:content url="https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4896-18249/238-78/javaone_lg.jpg" medium="image">
			<media:title type="html">javaone_lg.jpg</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2012/03/arq_pres.png" medium="image">
			<media:title type="html">arq_pres</media:title>
		</media:content>

		<media:content url="https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4896-18250/202-69/alr_signature.gif" medium="image">
			<media:title type="html">alr_signature.gif</media:title>
		</media:content>
	</item>
		<item>
		<title>Affirmative Action &#124; The Power of Yes</title>
		<link>http://exitcondition.alrubinger.com/2012/02/26/affirmative-action-the-power-of-yes/</link>
		<comments>http://exitcondition.alrubinger.com/2012/02/26/affirmative-action-the-power-of-yes/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 09:24:30 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>

		<guid isPermaLink="false">http://exitcondition.alrubinger.com/?p=235</guid>
		<description><![CDATA[Prior to inking my employment with JBoss, I served as backend developer for a firm specializing in rich-media webapps.  The founders at the excellent 9mmedia in Manhattan have background in user interface and interactive design, and as such built a team heavily centered along these core competencies.  So I was always a bit of an oddball [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=235&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Prior to inking my employment with JBoss, I served as backend developer for a firm specializing in rich-media webapps.  The founders at the excellent <a href="http://9mmedia.com/" target="_blank">9mmedia</a> in Manhattan have background in user interface and interactive design, and as such built a team heavily centered along these core competencies.  So I was always a bit of an oddball by nature of my minority role in the place.</p>
<p>Around the same time, Agile Development was really collecting religious momentum, and a guiding precept there was roughly: &#8220;Do only what needs to be done now.&#8221;</p>
<p>This makes sense; it helps to ensure that we avoid scope creep, we don&#8217;t invent requirements that may end up being unnecessary, and we don&#8217;t overengineer.  Let&#8217;s just focus on delivering the minimal set necessary, then worry about expanding it later.</p>
<p>As such, I adopted the &#8220;no&#8221; philosophy.  I figured that if a feature was really that important, it would persist and nag in some way until it was included.  Otherwise, it must not be that worthy.  So as a default, my answer to everything was &#8220;no.&#8221;  Like a knee-jerk reaction: no.  Want me to do something new?  No.  New technologies?  No.  Component upgrades?  No.</p>
<p>It&#8217;s not a hard methodology to enforce.  Just pretend you&#8217;re every girl I&#8217;ve ever met.  &#8221;No.&#8221;</p>
<p>So then I came aboard into Professional Open Source in building the EJB3 Container for the JBoss Application Server with <a href="https://twitter.com/#!/wolfc71" target="_blank">Carlo de Wolf</a>.  Oh boy, does that guy know how to separate concerns.  Over the course of a few years my new and reluctant mentor would drill into my head the importance of defining a contract for interaction between components and keeping everything in their rightful place.  Does this belong here?  No.  Build a new thing.  Then integrate it.  It carried along my tradition of &#8220;no&#8221; quite nicely, but at least it offered, &#8220;not here, go play over there&#8221;.</p>
<p>Then I got really sick of running the EJB3 TestSuite upon JBossAS, and started building out some tools &#8211; some great, some hacky &#8211; to improve the situation.  One of these, a then-unnamed API for manipulating Java Archives, caught the attention of some dude from Oslo named <a href="https://twitter.com/#!/aslakknutsen" target="_blank">Aslak Knutsen</a>.  Who really started fucking up my universe.</p>
<p>This guy wanted to implement every single integration and feature under the sun.  He wanted to deploy these archives not only into AS, but other vendors.  He wanted to use custom JUnit runners.  He wanted to code stuff just to see if it could be done.  And he&#8217;d prototype a way to do it.  For awhile, it was all I could do to keep up with this runaway nutjob that I was sure we&#8217;d never be able to support or put into any maintainable form.</p>
<p>The Java Archive API became, of course, <a href="http://www.jboss.org/shrinkwrap" target="_blank">ShrinkWrap</a>, and Aslak went on to employment with us as lead of the <a href="http://www.jboss.org/arquillian" target="_blank">Arquillian</a> Testing Platform.</p>
<p>And still I advised, &#8220;Slow down.&#8221;  We needed to keep focus on our primary goals here.  We needed to learn to say &#8220;no&#8221;.</p>
<p>Well, &#8220;no&#8221; isn&#8217;t in the Norwegian dictionary, I suppose.  And it certainly didn&#8217;t help matters to have Seam lunatic <a href="https://twitter.com/#!/mojavelinux" target="_blank">Dan Allen</a> be coming along to goad on what was becoming an endless litany of &#8220;cool stuff we could do&#8221;.  My little team was comprised of children prone to chasing shiny balls; fantastic.</p>
<p>In the years that followed, we&#8217;ve watched the Arquillian Suite of projects blossom into a wide array of tools intent on easing the testing of Enterprise Java.  And it turns out, just by trying new ideas in a sometimes half-baked fashion, having something concretely usable is enough to determine if the concept has merit.  Other people in open source will pick it up, be drawn to it.  We&#8217;ve got contributors coming in from all sorts of angles: &#8220;What about the UI?&#8221;  &#8221;What about Behavior-Driven Development?&#8221;  &#8221;What about Persistence?&#8221;  &#8221;What about&#8230;&#8221;</p>
<p>Turns out the risk of taking on too much or letting quality suffer naturally corrected itself as these ideas matured.  And the bad ideas just silently died, with minimal effort wasted.</p>
<p>I remember reading something once written by Red Hat People and Brand SVP DeLisa Alexander about the willingness to fail acceptably.  Meaning that if you invest minimally in a bunch of ideas, your eggs aren&#8217;t all in one basket and you can afford to lose a few along the way.  From those eggs, you just might get some extra chickens you weren&#8217;t expecting, which in turn makes: yep &#8211; more eggs.  In short, saying &#8220;yes&#8221; solves the chicken/egg problem.</p>
<p>But none of this really hit home for me until today.  For one, I&#8217;ve been debating with a colleague about accepting more risk in general.  About having the faith to try some new things, even if they may not work out I believe the acceptable risk quota is still in the black.  And I took some time away from this lengthy email exchange to read Tina Fey&#8217;s &#8220;<a href="http://en.wikipedia.org/wiki/Bossypants" target="_blank">Bossypants</a>&#8220;.</p>
<p>See, Tina spent her formative years as a professional comedienne in a Chicago-based improv troupe where the rule is, &#8220;Yes, And&#8230;&#8221;.  Meaning no matter the premise of the scene thrown at you, agree with your costar.  And then add upon it.  Wrong answers do not exist.  It&#8217;s an exhilarating approach.</p>
<p>Of course, I work in software and business.  Obviously wrong answers exist.  Most answers are probably wrong.  But when I&#8217;m wearing my hat as a creative problem-solver, probably it&#8217;s useful to invest just a little bit into each stupid nugget that comes across, or at least enable the idea-bearer to make some headway on his/her own.  Because I still believe I was right before: good ideas will persist.  Just don&#8217;t kill them too quickly.</p>
<p>Yes.  It&#8217;s so simple.  Minimally commit yourself to new things and see if they warrant further investment.</p>
<p>And if you have any doubts at all about this approach, check out the movie &#8220;<a href="http://www.imdb.com/title/tt1068680/" target="_blank">Yes Man</a>.&#8221;  Because Jim Carrey embraces the affirmative, and he gets to nail Zooey Deschanel.</p>
<p>S,</p>
<p><a href="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif"><img class="alignnone size-full wp-image-167" title="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640" alt=""   /></a><br />
ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/235/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=235&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2012/02/26/affirmative-action-the-power-of-yes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
		<item>
		<title>Planes, Trains, and Automobiles &#124; JBoss European Tour 2011 Part II</title>
		<link>http://exitcondition.alrubinger.com/2011/12/13/planes-trains-and-automobiles-jboss-european-tour-2011-part-ii/</link>
		<comments>http://exitcondition.alrubinger.com/2011/12/13/planes-trains-and-automobiles-jboss-european-tour-2011-part-ii/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 03:36:42 +0000</pubDate>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
				<category><![CDATA[We Put the "E" In JEE.  The first "E".]]></category>
		<category><![CDATA[event]]></category>

		<guid isPermaLink="false">http://exitcondition.wordpress.com/?p=225</guid>
		<description><![CDATA[Well, we last left our heros in Sofia embraced by the charming hospitality of Yoana Ivanova and the rest of the Java2Days crew. In the afterglow of a successful JBoss presence at the conference, Lincoln and I allowed ourselves to be persuaded to stay out with community contributor Ivan way past bedtime; night turned to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=225&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Well, we last left our heros in Sofia embraced by the charming hospitality of Yoana Ivanova and the rest of the <a href="http://2011.java2days.com/" target="_blank">Java2Days</a> crew. In the afterglow of a successful JBoss presence at the conference, <a href="https://twitter.com/#!/lincolnthree" target="_blank">Lincoln</a> and I allowed ourselves to be persuaded to stay out with community contributor <a href="https://twitter.com/#!/ivan_stefanov" target="_blank">Ivan</a> way past bedtime; night turned to day without rest inbetween, and Team JBoss was again on a plane set to catch up with the Parisians.</p>
<div id="attachment_228" class="wp-caption alignnone" style="width: 210px"><a href="http://exitcondition.files.wordpress.com/2011/12/alr_leaving_paris.jpg"><img class="size-medium wp-image-228" title="alr_leaving_paris" src="http://exitcondition.files.wordpress.com/2011/12/alr_leaving_paris.jpg?w=200&#038;h=300" alt="" width="200" height="300" /></a><p class="wp-caption-text">Who&#039;s the ignorant American now?!</p></div>
<p>France was the one gap in my schedule devoid of conferences or technical engagements, and I was thouroughly amped to see the city. Of course, when you&#8217;re staying with Seam Social Lead <a href="https://twitter.com/#!/antoine_sd" target="_blank">Antoine Sabot-Durand&#8217;s</a> family, the experience gets amplified as we had the chance to geek out along the way. Throw into the mix old friends like Hibernate/data guru <a href="https://twitter.com/#!/emmanuelbernard" target="_blank">Emmanuel Bernard</a> and new ones like Java EE author <a href="http://www.antoniogoncalves.org/xwiki/bin/view/Main/WebHome" target="_blank">Antonio Goncalves</a>, and now we&#8217;re cooking with gas. My apologies to the <a href="http://www.parisjug.org/xwiki/bin/view/Main/WebHome" target="_blank">ParisJUG</a> community as we were only in town for the weekend, but I&#8217;m hoping to meet your thriving group in the flesh some day sooner than later.</p>
<div id="attachment_227" class="wp-caption alignnone" style="width: 310px"><a href="http://exitcondition.files.wordpress.com/2011/12/antonio_book.jpg"><img class="size-medium wp-image-227" title="antonio_book" src="http://exitcondition.files.wordpress.com/2011/12/antonio_book.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a><p class="wp-caption-text">Antonio&#039;s Book, Proudly displayed at the Wine Bar in which it was largely penned.</p></div>
<p>The discussion on this leg that held most interest for me stemmed from a question raised by Antonio on the relationship between JBoss projects. Through the past few weeks I&#8217;ve had the chance to think on this further, and I&#8217;ve come to this: upstream projects should be given as much freedom and flexibility as can be permitted.</p>
<p>I don&#8217;t believe we do the community a disservice by giving as much leverage for individual projects to use whatever tools and mechanisms they deem appropriate. Build systems, documentation delivery, SCM, development methodologies, you name it. I&#8217;ve been a part of great projects that run &#8220;my&#8221; way, and I&#8217;ve struggled to work alongside equally great projects that run counter to my every instinct. That&#8217;s the beauty of letting a community shape the direction of the project; it becomes a breathing organism which molds to its creators&#8217; tastes. Unification of projects is not an important construct to me. It&#8217;s Darwinian. Some undertakings will fail, either because they&#8217;re conceptually flawed or poorly run. And we should let them.</p>
<p>That&#8217;s why we have the notion of products. For the Enterprise we need to take these ideas and code which have matured, and focus on a streamlined delivery process that makes everything look the same. So if you ask me, let projects run free and arm them with all the tools they need to succeed. Make suggestions for how they should build their communities. But impose judiciously. And allow the supported product to fit the need for customers who rely upon the unification services.</p>
<p>In that light, I&#8217;m awfully proud in particular of my teammates Dan, Aslak, and Lincoln. I think about the type of outreach we do, about the type of investment in building the community and the thought that goes into all of the stuff that doesn&#8217;t involve code. Dan and his wife Sarah singlehandedly introduced a much more radical and effective presentation platform for us. Not to mention near-daily emails containing some allegory to building software. Aslak is on the IRC channels daily, and his engagement has grown from fielding user questions to coaching ARQ developers. And Lincoln took the task of bootstrapping projects and turned it on its rear-end, making Forge an all-out plugin community with limitless bounds.</p>
<p>For my part, I think the emphasis was always placed on limiting the barriers to entry for new contributors. It&#8217;s not a deceptive formula: define small scopes, bite off little bits at a time, and focus first on the API and its use. I&#8217;m a simple guy.</p>
<p>But I digress. Paris. Also there was wine. And laughter. The two were likely related.</p>
<div id="attachment_226" class="wp-caption alignnone" style="width: 210px"><a href="http://exitcondition.files.wordpress.com/2011/12/escargot.jpg"><img class="size-medium wp-image-226" title="escargot" src="http://exitcondition.files.wordpress.com/2011/12/escargot.jpg?w=200&#038;h=300" alt="" width="200" height="300" /></a><p class="wp-caption-text">Slow as a snail? JBoss eats snails.</p></div>
<p>Speed is to become a theme starting in the next installment, after Linc and I hit the TGV outbound to Stuttgart to meet up with Da Germans.</p>
<p>S,</p>
<p><a href="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif"><img class="alignnone size-full wp-image-167" title="ALR" src="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif?w=640" alt=""   /></a></p>
<p>ALR</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/exitcondition.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/exitcondition.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=exitcondition.alrubinger.com&#038;blog=1707330&#038;post=225&#038;subd=exitcondition&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://exitcondition.alrubinger.com/2011/12/13/planes-trains-and-automobiles-jboss-european-tour-2011-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4369758fcee235bebd875f0de34aa42e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/12/alr_leaving_paris.jpg?w=200" medium="image">
			<media:title type="html">alr_leaving_paris</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/12/antonio_book.jpg?w=300" medium="image">
			<media:title type="html">antonio_book</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/12/escargot.jpg?w=200" medium="image">
			<media:title type="html">escargot</media:title>
		</media:content>

		<media:content url="http://exitcondition.files.wordpress.com/2011/10/alr_signature.gif" medium="image">
			<media:title type="html">ALR</media:title>
		</media:content>
	</item>
	</channel>
</rss>
