<?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/"
	>

<channel>
	<title>Martin Ahrer - Together we&#039;ll make IT &#187; Maven</title>
	<atom:link href="http://www.martinahrer.at/tag/maven/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.martinahrer.at</link>
	<description>Java Enterprise Softwareentwicklung und Consulting</description>
	<lastBuildDate>Sun, 11 Dec 2011 16:19:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<meta name="generator" content="deSignum 0.8.1" />
		<item>
		<title>AspectJ runtime weaving within a Maven build</title>
		<link>http://www.martinahrer.at/2010/10/16/aspectj-runtime-weaving-within-a-maven-build/</link>
		<comments>http://www.martinahrer.at/2010/10/16/aspectj-runtime-weaving-within-a-maven-build/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 16:11:06 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AspectJ]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=654</guid>
		<description><![CDATA[In order to perform AspectJ runtime weaving, an agent is required. Here we are using the agent (spring-instrument-3.0.3.RELEASE) provided by the Springframework. So for surefire we have to use a command line argument -javaagent: that specifies the JAR file containing the agent. To keep the build portable we copy that artifact to the build directory [...]]]></description>
			<content:encoded><![CDATA[<p>In order to perform AspectJ runtime weaving, an agent is required. Here we are using the agent (spring-instrument-3.0.3.RELEASE) provided by the Springframework. So for surefire we have to use a command line argument -javaagent: that specifies the JAR file containing the agent. To keep the build portable we copy that artifact to the build directory first using the maven-dependency-plugin.<br />
<span id="more-654"></span></p>
<pre class="brush:xml">
&lt;plugin&gt;
	&lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
	&lt;executions&gt;
		&lt;execution&gt;
			&lt;id&gt;copy&lt;/id&gt;
			&lt;phase&gt;process-sources&lt;/phase&gt;
			&lt;goals&gt;
				&lt;goal&gt;copy&lt;/goal&gt;
			&lt;/goals&gt;
			&lt;configuration&gt;
				&lt;artifactItems&gt;
					&lt;artifactItem&gt;
						&lt;groupId&gt;org.springframework&lt;/groupId&gt;
						&lt;artifactId&gt;spring-instrument&lt;/artifactId&gt;
						&lt;version&gt;3.0.3.RELEASE&lt;/version&gt;
					&lt;/artifactItem&gt;
				&lt;/artifactItems&gt;
			&lt;/configuration&gt;
		&lt;/execution&gt;
	&lt;/executions&gt;
&lt;/plugin&gt;
</pre>
<p>We have to pass in the weaving agent to surefire.</p>
<pre class="brush:xml">
&lt;plugin&gt;
	&lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
	&lt;configuration&gt;
		&lt;argLine&gt;-javaagent:${project.build.directory}/dependency/spring-instrument-3.0.3.RELEASE.jar&lt;/argLine&gt;
	&lt;/configuration&gt;
&lt;/plugin&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2010/10/16/aspectj-runtime-weaving-within-a-maven-build/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Nexus and the Nexus REST API for implementing a software update tool</title>
		<link>http://www.martinahrer.at/2010/05/25/using-nexus-and-the-nexus-rest-api-for-implementing-a-software-update-tool/</link>
		<comments>http://www.martinahrer.at/2010/05/25/using-nexus-and-the-nexus-rest-api-for-implementing-a-software-update-tool/#comments</comments>
		<pubDate>Tue, 25 May 2010 20:03:42 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=456</guid>
		<description><![CDATA[Nexus is using a pretty well documented REST API which is usable externally as well. For one of my customers I implemented a kind of automatic software update tool that can be embedded into any product. It is based on the Sonatype NEXUS repository manager. That tool performs the following steps Detect the current software [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://nexus.sonatype.org/">Nexus </a> is using a pretty well documented REST API which is usable externally as well.<br />
For one of my customers I implemented a kind of automatic software update tool that can be embedded into any product. It is based on the Sonatype NEXUS repository manager.</p>
<p><span id="more-456"></span></p>
<p>That tool performs the following steps</p>
<ol>
<li>Detect the current software version from the artifact metadata that is embedded into any Maven-built artifact</li>
<li>Query Nexus for available artifacts for the installed software (identified by Maven groupId and artifactId).</li>
<li>Test if any of the available artfacts has a version number higher than the installed one</li>
<li>If a newer version is available then download it</li>
<li>Move the new version to the target directory (e.g. the deployment folder of the application server)</li>
</ol>
<p>The Nexus REST url for a simple query for some artifact looks like <code>http://localhost/nexus/service/local/data_index/repositories/releases/content?q=commons-lang</code>. This query asks for the <em>commons-lang</em> artifact from the <em>releases repository</em>.</p>
<p>More URL schemes are documented <a href="https://docs.sonatype.com/display/NX/Nexus+Rest+API">here</a> and <a href="https://grid.sonatype.org/ci/view/Nexus/job/Nexus/label=ubuntu/ws/trunk/nexus/nexus-rest-api/target/classes/docs/index.html">there</a>.</p>
<p>The result from this query is like (only the latest versions are included for brevity):</p>
<pre class="brush:xml">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;search-results&gt;
	&lt;totalCount&gt;5&lt;/totalCount&gt;
	&lt;from&gt;-1&lt;/from&gt;
	&lt;count&gt;-1&lt;/count&gt;
	&lt;tooManyResults&gt;false&lt;/tooManyResults&gt;
	&lt;data&gt;
		&lt;artifact&gt;

			&lt;resourceURI&gt;http://localhost/nexus/service/local/repositories/central/content/commons-lang/commons-lang/2.4/commons-lang-2.4.jar&lt;/resourceURI&gt;
			&lt;groupId&gt;commons-lang&lt;/groupId&gt;
			&lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
			&lt;version&gt;2.4&lt;/version&gt;
			&lt;packaging&gt;jar&lt;/packaging&gt;
			&lt;extension&gt;jar&lt;/extension&gt;

			&lt;repoId&gt;central&lt;/repoId&gt;
			&lt;contextId&gt;Maven Central (Cache)&lt;/contextId&gt;
			&lt;pomLink&gt;http://localhost/nexus/service/local/artifact/maven/redirect?r=central&amp;g=commons-lang&amp;a=commons-lang&amp;v=2.4&amp;e=pom&lt;/pomLink&gt;
			&lt;artifactLink&gt;http://localhost/nexus/service/local/artifact/maven/redirect?r=central&amp;g=commons-lang&amp;a=commons-lang&amp;v=2.4&amp;e=jar&lt;/artifactLink&gt;

		&lt;/artifact&gt;
		&lt;artifact&gt;
			&lt;resourceURI&gt;http://localhost/nexus/service/local/repositories/central/content/commons-lang/commons-lang/2.4/commons-lang-2.4-sources.jar&lt;/resourceURI&gt;
			&lt;groupId&gt;commons-lang&lt;/groupId&gt;
			&lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
			&lt;version&gt;2.4&lt;/version&gt;
			&lt;classifier&gt;sources&lt;/classifier&gt;

			&lt;packaging&gt;jar&lt;/packaging&gt;
			&lt;extension&gt;jar&lt;/extension&gt;
			&lt;repoId&gt;central&lt;/repoId&gt;
			&lt;contextId&gt;Maven Central (Cache)&lt;/contextId&gt;
			&lt;pomLink&gt;&lt;/pomLink&gt;
			&lt;artifactLink&gt;http://localhost/nexus/service/local/artifact/maven/redirect?r=central&amp;g=commons-lang&amp;a=commons-lang&amp;v=2.4&amp;e=jar&amp;c=sources&lt;/artifactLink&gt;

		&lt;/artifact&gt;

	&lt;/data&gt;
&lt;/search-results&gt;
</pre>
<p>That only needs to be parsed using a SAX parser for extracting the most important elements. This is the Maven GAV, packaging, classifier, and  the download url which are stored in a POJO. This POJO implements the algorithm for selecting the latest version by its compareTo method.</p>
<pre class="brush:java">
public class MavenArtifactMetadata implements Comparable&lt;MavenArtifactMetadata&gt; {
	private String groupId;
	private String artifactId;
	private String version;
	private String resourceURI;
	private String packaging;
	private String classifier;

	@Override
	public int compareTo(MavenArtifactMetadata o) {
		if (!this.groupId.equals(o.groupId) || !this.artifactId.equals(o.artifactId)) {
			return -1;
		}
		return versionCompareTo(o.version);
	}

	int versionCompareTo(String version) {
		Integer[] thatVersion = versionComponents(version);
		Integer[] thisVersion = versionComponents(this.version);
		int length = Math.min(thatVersion.length, thisVersion.length);
		for (int i = 0; i < length; i++) {
			if (thatVersion[i].equals(thisVersion[i])) {
				continue;
			}
			return thisVersion[i].compareTo(thatVersion[i]);
		}
		return thisVersion.length - thatVersion.length;
	}

	Integer[] versionComponents(String version) {
		String[] splitted = StringUtils.delimitedListToStringArray(version, ".");
		if (splitted.length>0 &#038;&#038; splitted[splitted.length-1].endsWith("-SNAPSHOT")) {
			splitted[splitted.length-1]=splitted[splitted.length-1].replaceAll("-SNAPSHOT", "");
		}
		Integer[] components = new Integer[splitted.length];
		for (int i = 0; i < splitted.length; i++) {
			components[i] = (Integer.valueOf(splitted[i]));
		}
		return components;
	}
}
</pre>
<p>While implementing the download part I had learned an important lesson. For downloading and moving large files it is much more efficient to use the Java NIO API.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2010/05/25/using-nexus-and-the-nexus-rest-api-for-implementing-a-software-update-tool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Spring has its own Expression Language as of version 3.0</title>
		<link>http://www.martinahrer.at/2009/11/26/spring-has-its-own-expression-language-as-of-version-3-0/</link>
		<comments>http://www.martinahrer.at/2009/11/26/spring-has-its-own-expression-language-as-of-version-3-0/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 05:06:01 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Springframework]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=339</guid>
		<description><![CDATA[Recently I have switched from the log4j logging framework to the logback framework. logback seems to have evolved into something better than log4j. It has cool features like the ability of logging into context specific logging files almost out-of-the-box (Using a sifting appender). However the application has to provide the context (usually as MDC variables) [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have switched from the log4j logging framework to the <a href="http://logback.qos.ch">logback</a> framework. logback seems to have evolved into something better than log4j. It has cool features like the ability of logging into context specific logging files almost out-of-the-box (Using a sifting appender).<br />
However the application has to provide the context (usually as MDC variables) which is kind of boring task to do.</p>
<p>So, I have implemented a fairly generic servlet that is able to provide almost any servlet request information for an active HTTP request. This servlet accepts a set of <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch06.html">SpEL </a>expressions (SpEL will be available with Spring 3.0) which are parsed and evaluated.<br />
Finally it produces the evaluation results as MDC variables through the <a href="http://www.slf4j.org/api/org/slf4j/MDC.html">org.slf4j.MDC</a> api (So I guess that might be usable for log4j as well).</p>
<pre class="brush:xml">
<filter>
	<filter-name>slf4jmdc</filter-name>
	<filter-class>at...SpringExpressionSlf4jMdcRequestFilter</filter-class>
	<init-param>
<param-name>mdcKeyExpression</param-name>
<param-value>contextPath=${request.contextPath};username=${request.userPrincipal?.name}</param-value>
	</init-param>
</filter>
</pre>
<pre class="brush:java">
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
	StandardEvaluationContext context = new StandardEvaluationContext(new RootObject(request));
	ExpressionParser parser = new SpelExpressionParser();

	String[] mdc = StringUtils.delimitedListToStringArray(mdcKeyExpression, ";");
	Properties expressions = StringUtils.splitArrayElementsIntoProperties(mdc, "=");

	Enumeration<?> keyNames = expressions.propertyNames();
	while (keyNames.hasMoreElements()) {
		String key = keyNames.nextElement().toString();
		try {
			Expression exp = parser.parseExpression(expressions.getProperty(key), new TemplateParserContext());
			Object value = exp.getValue(context);
			if (value != null) {
				MDC.put(key, value.toString());
			}
		} catch (ParseException e) {
			LOGGER.error("Parsing expression", e);
		}
	}

	try {
		filterChain.doFilter(request, response);
	} finally {
		while (keyNames.hasMoreElements()) {
			MDC.remove(keyNames.nextElement().toString());
		}
	}
}
</pre>
<p>This servlet can be used about anywhere MDC variables are needed!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2009/11/26/spring-has-its-own-expression-language-as-of-version-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating Spring projects to Spring 3.0.0 bundle repositories</title>
		<link>http://www.martinahrer.at/2009/11/19/migrating-spring-projects-to-spring-3-0-0-bundle-repositories/</link>
		<comments>http://www.martinahrer.at/2009/11/19/migrating-spring-projects-to-spring-3-0-0-bundle-repositories/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 06:00:16 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Springframework]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=330</guid>
		<description><![CDATA[Since Spring has started its strong support for OSGi, all spring libraries have been turned into OSGi bundles internally. Subprojects (e.g. Webflow) eventually also started to publish their jars using the bundle naming scheme. With Spring 3.0 it looks we are at the final destination. As long as you stick to the more populare frameworks [...]]]></description>
			<content:encoded><![CDATA[<p>Since Spring has started its strong support for OSGi, all spring libraries have been turned into OSGi bundles internally. Subprojects (e.g. Webflow) eventually also started to publish their jars using the bundle naming scheme. With Spring 3.0 it looks we are at the final destination. As long as you stick to the more populare frameworks you get a pretty complete repository of Maven artifacts.</p>
<p>On one side it is good to see a unique naming for all of the spring + subproject artifacts. But for those of you starting to migrate existing projects this causes a few headaches. Everything is fine as long as you can get all of your favourite libraries from one of the SpringSpource bundle repositories</p>
<pre class="brush:xml">
<repositories>
	<repository>
		<id>SpringSource Enterprise Bundle Repository - External Bundle Milestones</id>
		<url>http://repository.springsource.com/maven/bundles/milestone</url>
	</repository>
	<repository>
		<id>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</id>
		<url>http://repository.springsource.com/maven/bundles/release</url>
	</repository>
	<repository>
		<id>SpringSource Enterprise Bundle Repository - External Bundle Releases</id>
		<url>http://repository.springsource.com/maven/bundles/external</url>
	</repository>
</repositories>
</pre>
<p>Fortunately they also provide a really helpful tool for <a href="http://www.springsource.com/repository/app/search">searching </a>their repositories.</p>
<p>But sometimes you won&#8217;t find your favourite ones and need to fall back to non-bundle style artifacts from non-Springsource repositories.<br />
And here is the trouble: <em>SpringSource is renaming the Maven artifactId for all of the bundles stored in their repositories (e.g. com.springsource.org.apache.commons.logging is the bundle equivalent of org.apache.commons.logging)</em>.</p>
<p>So let&#8217;s say you depend on artifact A that comes from the bundle repository (that depends on logging) and also depend on artifact B that comes from the standard maven repository (and also dependes on logging).<br />
This will end up with a 2 dependencies to the logging artifact and Maven will not be able to distinguish since they have a different artifactId.</p>
<p>To resolve that, start adding dependency exclusions and dependencies for first level transitive dependencies.</p>
<p>I&#8217;m showing an example for the <a href="http://redmine.synyx.org/projects/show/hades">hades </a>project that actually has a bug in their dependency description.</p>
<pre class="brush:xml">
<dependency>
	<groupId>org.synyx.hades</groupId>
	<artifactId>org.synyx.hades</artifactId>
	<version>1.0</version>
	<exclusions>
		<exclusion>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
		</exclusion>
	</exclusions>
</dependency>
<dependency>
	<groupId>org.aspectj</groupId>
	<artifactId>com.springsource.org.aspectj.runtime</artifactId>
	<version>1.6.1</version>
</dependency>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2009/11/19/migrating-spring-projects-to-spring-3-0-0-bundle-repositories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eclipse and corrupt WTP metadata</title>
		<link>http://www.martinahrer.at/2008/12/04/eclipse-and-corrupt-wtp-metadata/</link>
		<comments>http://www.martinahrer.at/2008/12/04/eclipse-and-corrupt-wtp-metadata/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 09:23:39 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=90</guid>
		<description><![CDATA[Yesterday night I had spent an hour or so tracking down a bug that has been bothering me for a while. The effect of this bug is that projects created with the m2eclipse plugin seem to be missing some important metadata required by the WTP plugins. As a result references to other projects (in workspace) [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday night I had spent an hour or so tracking down a bug that has been bothering me for a while.<br />
The effect of this bug is that projects created with the m2eclipse plugin seem to be missing some important metadata required by the WTP plugins. As a result references to other projects (in workspace) do not show up as JavaEE (J2EE) module dependencies or sometimes even the project properties dialog for JavaEE module dependencies only shows an error.<br />
I had analysed this bug a while ago already but never documented this, some more investigation is still required to figure out what causes this missing metadata and report it to the m2eclipse developers.</p>
<p>Anyway here is how to fix it. Let&#8217;s say we have a web project A and a utility project B. You face the situation that project B does not show up as JavaEE module dependency. Open B in the navigator view (so you can see all the metadata files .project, .settings/&#8230; etc.).<br />
Look for a file .settings/org.eclipse.wst.common.component! Does it exist? If no just create it, its contents should be like</p>
<pre lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="PROJECTNAME">
        <wb-resource deploy-path="/" source-path="/src/main/java"/>
        <wb-resource deploy-path="/" source-path="/src/test/java"/>
    </wb-module>
</project-modules>
</pre>
<p>Next check the .project file</p>
<pre lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>PROJECTNAME</name>
	<comment></comment>
<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.wst.common.project.facet.core.builder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.maven.ide.eclipse.maven2Builder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.validation.validationbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.jdt.core.javanature</nature>
		<nature>org.maven.ide.eclipse.maven2Nature</nature>
		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
	</natures>
</projectDescription>
</pre>
<p>In my case the file was missing some builders (should not be relevant for the bug)</p>
<ul>
<li>org.maven.ide.eclipse.maven2Builder</li>
<li>
org.eclipse.wst.validation.validationbuilder</li>
</ul>
<p>and some natures (these really hurt)</p>
<ul>
<li>org.eclipse.wst.common.modulecore.ModuleCoreNature</li>
<li>org.eclipse.jem.workbench.JavaEMFNature</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2008/12/04/eclipse-and-corrupt-wtp-metadata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>el-ri</title>
		<link>http://www.martinahrer.at/2008/08/26/el-ri/</link>
		<comments>http://www.martinahrer.at/2008/08/26/el-ri/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 11:38:40 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=86</guid>
		<description><![CDATA[Occasionally I need the EL reference implementation in my projects. JARS are hard to find. They seem to be provided by JBoss MAven2 repositories only. The repository URL is http://repository.jboss.org/maven2 . javax.el el-api 1.2 provided javax.el el-ri 1.2 provided]]></description>
			<content:encoded><![CDATA[<p>Occasionally I need the EL reference implementation in my projects. JARS are hard to find. They seem to be provided by JBoss MAven2 repositories only. The repository URL is <a href="http://repository.jboss.org/maven2">http://repository.jboss.org/maven2</a> .</p>
<pre lang="xml" line="1">
<dependency>
	<groupId>javax.el</groupId>
	<artifactId>el-api</artifactId>
	<version>1.2</version>
	<scope>provided</scope>
</dependency>

<dependency>
	<groupId>javax.el</groupId>
	<artifactId>el-ri</artifactId>
	<version>1.2</version>
	<scope>provided</scope>
</dependency>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2008/08/26/el-ri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven Repository Index</title>
		<link>http://www.martinahrer.at/2008/07/18/maven-repository-index/</link>
		<comments>http://www.martinahrer.at/2008/07/18/maven-repository-index/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 09:28:33 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=84</guid>
		<description><![CDATA[Sonatype one of the companies actively contributing to Maven has brought their Nexus 1.0.0-beta online. Previously I was using mvnrepository for finding Maven artifacts. I find Nexus much faster and it&#8217;s not polluted with ads and other stuff.]]></description>
			<content:encoded><![CDATA[<p>Sonatype one of the companies actively contributing to Maven has brought their <a href="http://repository.sonatype.org/">Nexus 1.0.0-beta</a> online. Previously I was using <a href="http://www.mvnrepository.com/">mvnrepository </a>for finding Maven artifacts.<br />
I find Nexus much faster and it&#8217;s not polluted with ads and other stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2008/07/18/maven-repository-index/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Embedding (constant) resources in a web application</title>
		<link>http://www.martinahrer.at/2008/03/07/embedding-constant-resources-in-a-web-application/</link>
		<comments>http://www.martinahrer.at/2008/03/07/embedding-constant-resources-in-a-web-application/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 08:10:14 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/2008/03/07/embedding-constant-resources-in-a-web-application/</guid>
		<description><![CDATA[Typically a nice looking web application would host plenty of icons in its document directories. Personally I use icons from the tango desktop project a lot. It is a library of hundreds of useful icons in multiple sizes. So I would pull these file into my web project every time I create a new one [...]]]></description>
			<content:encoded><![CDATA[<p>Typically a nice looking web application would host plenty of icons in its document directories.  Personally I use icons from the <a href="http://tango.freedesktop.org/Tango_Desktop_Project">tango </a>desktop project a lot. It is a library of hundreds of useful icons in multiple sizes.</p>
<p>So I would pull these file into my web project every time I create a new one and update these files as new tango version are released. This is not very handy as it is hard to synchronize these icons. On top of that code repository operations really slow down when checking out from or committing to the repository (just like it is with jars in the WEB-INF/lib folder).</p>
<p>As I have used Maven now for a while I had the idea of creating a kind of icon project that can be included in any web application just like an ordinary dependeny. This project only contains a project descriptor (pom.xml) which declares it as a project of type <strong>war</strong>. Further it includes the tango icons in the folder images/tango<br />
plus a WEB-INF/web.xml (without any specific configuration, pretty much empty).<br />
Any project that requires tango dektop icons just declares a maven dependency to this icon project. Any time this project is packaged (as a war file) Maven automatically unpacks the icon project into the packaged project and thus makes sure that it is up to date.<br />
<span id="more-57"></span></p>
<pre lang="xml"><dependency>
         <groupId>com.example.projects</groupId>
         <artifactId>tango-desktop-icons</artifactId>
         <version>1.0-SNAPSHOT</version>
         <type>war</type>
         <scope>runtime</scope>
</dependency>
</pre>
<p>For working within an IDE it is sufficient to perform the Maven command <strong>war:inplace</strong> to unpack the icon project into the project workspace!</p>
<p>This is called <a href="http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html">WAR overlaying</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2008/03/07/embedding-constant-resources-in-a-web-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven2 eclipse web tools platform integration</title>
		<link>http://www.martinahrer.at/2007/10/11/maven2-eclipse-web-tools-platform-integration/</link>
		<comments>http://www.martinahrer.at/2007/10/11/maven2-eclipse-web-tools-platform-integration/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 18:39:35 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/2007/10/11/maven2-eclipse-web-tools-platform-integration/</guid>
		<description><![CDATA[When developing web applications it&#8217;s always been a hassle to keep the WEB-INF/lib folder up to date especially when starting to experiment with different versions of libraries or frameworks . In the past (since being a Maven2 user) I helped myself with issuing the mvn war:inplace command to pull in all required libraries into WEB-INF/lib. [...]]]></description>
			<content:encoded><![CDATA[<p>When developing web applications it&#8217;s always been a hassle to keep the WEB-INF/lib folder up to date especially when starting to experiment with different versions of libraries or frameworks .<br />
In the past (since being a Maven2 user) I helped myself with issuing the <strong>mvn war:inplace</strong> command to pull in all required libraries into WEB-INF/lib. So, occasionally I only would update my POM and rerun the command to have the latest versions of jars in my project!</p>
<p>This is extremely handy when using profiles for example to switch dependencies between a set of JSF 1.1 or JSF 1.2 libraries. Only with a twinkle I could change the classpath definition for any project. Ok so far this is nice.</p>
<p>For server development I&#8217;m working with the WTP plugin which makes handling a server a bit easier. So, regarding my library dependencies I&#8217;d feel more comfortable if they were updated every time I started my server (and thus publish the latest project files to the server).</p>
<p><a href="http://www.martinahrer.at/wp-content/uploads/2007/10/m2eclipse-wtp.png" title="Maven Library Container"><img src="http://www.martinahrer.at/wp-content/uploads/2007/10/m2eclipse-wtp.png" alt="Maven Library Container" width="100%" height="100%"/></a></p>
<p>So, I updated my <a href="http://m2eclipse.codehaus.org/">m2eclipse</a> plugin to 0.0.11 and tried to mark the Maven Dependencies Library Container as a J2EE Dependency, restarted my Web Container and was really excited that finally this is supported now. This means all of my dependencies from pom.xml are actually deployed to the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2007/10/11/maven2-eclipse-web-tools-platform-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven Repositories</title>
		<link>http://www.martinahrer.at/2007/07/24/maven-repositories/</link>
		<comments>http://www.martinahrer.at/2007/07/24/maven-repositories/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 13:35:56 +0000</pubDate>
		<dc:creator>Martin Ahrer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.martinahrer.at/?p=11</guid>
		<description><![CDATA[A short note to keep a few useful Maven repositories in mind. http://snapshots.repository.codehaus.org http://people.apache.org/repo/m2-snapshot-repository https://maven-repository.dev.java.net/]]></description>
			<content:encoded><![CDATA[<p>A short note to keep a few useful Maven repositories in mind.</p>
<ul>
<li>http://snapshots.repository.codehaus.org</li>
<li>http://people.apache.org/repo/m2-snapshot-repository</li>
<li>https://maven-repository.dev.java.net/</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.martinahrer.at/2007/07/24/maven-repositories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

