<?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>JSF Blog &#187; plugins</title>
	<atom:link href="http://www.jsfblog.info/tag/plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jsfblog.info</link>
	<description>Discussion on all things Java and JSF</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Maven pom Checkstyle configuration with Eclipse</title>
		<link>http://www.jsfblog.info/2011/02/maven-pom-checkstyle-configuration-with-eclipse/</link>
		<comments>http://www.jsfblog.info/2011/02/maven-pom-checkstyle-configuration-with-eclipse/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 20:09:30 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Eclipse IDE]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[checkstyle]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[m2eclipse]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[pom]]></category>

		<guid isPermaLink="false">http://www.jsfblog.info/?p=355</guid>
		<description><![CDATA[In a previous post on Eclipse plugins, two excellent plugins were mentioned which can automatically set up your Eclipse project to use the same Checkstyle configuration that is configured in your pom file. However, the only problem with both of these plugins is that they will only be able to find your Checkstyle configuration if [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous post on <a href="http://www.jsfblog.info/2010/11/useful-eclipse-plugins/">Eclipse plugins</a>, two excellent plugins were mentioned which can automatically set up your Eclipse project to use the same Checkstyle configuration that is configured in your pom file. However, the only problem with both of these plugins is that they will only be able to find your Checkstyle configuration if it is configured in the build section of the pom. If you just run Checkstlye as a reporting plugin, the plugins won&#8217;t pick up the configuration.</p>
<p>A very simple workaround for this is to take advantage of the <strong>skip</strong> parameter in the Checkstyle configuration. You can add the Checkstyle configuration into your build section of the pom and set the <strong>skip</strong> parameter to <strong>true</strong>. This will then prevent Checkstyle from running every time you build your project.</p>
<h3>Example code to use in your pom.xml</h3>
<pre class="brush: xml; highlight: [18]; title: ; notranslate">
&lt;properties&gt;
	&lt;checkstylePluginVersion&gt;2.6&lt;/checkstylePluginVersion&gt;
&lt;/properties&gt;
&lt;build&gt;
	&lt;plugins&gt;
		&lt;plugin&gt;
			&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
			&lt;artifactId&gt;maven-checkstyle-plugin&lt;/artifactId&gt;
			&lt;version&gt;${checkstylePluginVersion}&lt;/version&gt;
			&lt;executions&gt;
				&lt;execution&gt;
					&lt;goals&gt;
						&lt;goal&gt;check&lt;/goal&gt;
					&lt;/goals&gt;
				&lt;/execution&gt;
			&lt;/executions&gt;
			&lt;configuration&gt;
				&lt;skip&gt;true&lt;/skip&gt;
				&lt;configLocation&gt;customCheckstyle.xml&lt;/configLocation&gt;
			&lt;/configuration&gt;
			&lt;dependencies&gt;
				&lt;dependency&gt;
					&lt;groupId&gt;com.company.web&lt;/groupId&gt;
					&lt;artifactId&gt;company-maven-resources&lt;/artifactId&gt;
					&lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
				&lt;/dependency&gt;
			&lt;/dependencies&gt;
		&lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/build&gt;
&lt;reporting&gt;
	&lt;plugins&gt;
		&lt;plugin&gt;
			&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
			&lt;artifactId&gt;maven-checkstyle-plugin&lt;/artifactId&gt;
			&lt;version&gt;${checkstylePluginVersion}&lt;/version&gt;
			&lt;configuration&gt;
				&lt;skip&gt;false&lt;/skip&gt;
				&lt;configLocation&gt;customCheckstyle.xml&lt;/configLocation&gt;
			&lt;/configuration&gt;
        &lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/reporting&gt;
</pre>
<p>In the above, we are also using a custom artifact as a dependency of the Checkstyle plugin. This artifact is a jar file which contains the customCheckstyle.xml file. We have also got the example code above in a parent pom file, which is in it&#8217;s own maven module with a packaging of pom, and artifactId of custom-super-pom. This way, any modules can specify custom-super-pom as their parent. Then when imported into Eclipse, they will automatically have Ckeckstyle configured, which will be referencing the customCheckstyle.xml file. Also, as these modules will inherit the reporting section from the custom-super-pom, they don&#8217;t need to have Checkstyle specified in them. This is great, since now all the configuration is in one single pom, making it much easier to maintain and update.</p>
<p>To change the customCheckstyle.xml file, all you would need to do is edit the file within the company-maven-resources artifact, and then install the artifact into your local repository. If you are also using a repository manager like <a href="http://nexus.sonatype.org/" target="_blank">Nexus</a>, then deploy it there also. The following command takes care of it all:</p>
<pre class="brush: plain; title: ; notranslate">
mvn clean deploy
</pre>
<p>We have used a snapshot version for our super pom and custom maven resources modules so that when these are changed, we can just deploy new versions on top of the older ones. Then any modules that reference these snapshots should pick up the latest version of the artifcats the next time they are built.  You can also force the update to happen by passing in -U on the command line when building, if you find that it doesn&#8217;t seem to be checking for updates to snapshots automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jsfblog.info/2011/02/maven-pom-checkstyle-configuration-with-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful Eclipse Plugins</title>
		<link>http://www.jsfblog.info/2010/11/useful-eclipse-plugins/</link>
		<comments>http://www.jsfblog.info/2010/11/useful-eclipse-plugins/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 12:52:11 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[checkstyle]]></category>
		<category><![CDATA[Cobertura]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[m2eclipse]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[pmd]]></category>

		<guid isPermaLink="false">http://www.jsfblog.info/?p=299</guid>
		<description><![CDATA[A list of handy plugins for the Eclipse IDE eCobertura &#8211; Allows Cobertura code coverage to be run from the IDE directly eclipse-cs &#8211; Enforces coding standards using the CheckStyle tool PMD &#8211; Scans Java code and reports potential problems M2Eclipse &#8211; Maven integration from Sonatype m2e-extensions &#8211; Works with version 0.10 of the M2Eclipse [...]]]></description>
			<content:encoded><![CDATA[<p>A list of handy plugins for the <a href="http://www.eclipse.org/">Eclipse IDE</a></p>
<ul>
<li><a href="http://ecobertura.johoop.de/" target="_blank">eCobertura</a> &#8211; Allows <a href="http://cobertura.sourceforge.net/" target="_blank">Cobertura</a> code coverage to be run from the IDE directly</li>
<li><a href="http://eclipse-cs.sourceforge.net/" target="_blank">eclipse-cs</a> &#8211; Enforces coding standards using the <a href="http://eclipse-cs.sourceforge.net/" target="_blank">CheckStyle</a> tool</li>
<li><a href="http://pmd.sourceforge.net/eclipse/" target="_blank">PMD</a> &#8211; Scans Java code and reports potential problems</li>
<li><a href="http://m2eclipse.sonatype.org/" target="_blank">M2Eclipse</a> &#8211; Maven integration from Sonatype
<ul>
<li><a href="http://code.google.com/p/m2e-extensions/" target="_blank">m2e-extensions</a> &#8211; Works with version 0.10 of the M2Eclipse plugin. Can automatically setup Checkstyle and PMD configuration for Eclipse to match their configuration from the pom file if they are in it</li>
<li><a href="http://bimargulies.github.com/m2e-code-quality/" target="_blank">m2e-code-quality</a> &#8211; Same as m2e-extensions, except this one works with version 0.12 of the M2Eclipse plugin</li>
</ul>
</li>
</ul>
<p><strong>Note:</strong> both m2e-extensions and m2e-code-quality only work if you have the pmd and checkstyle plugins configured in the build section of the pom. They do not currently work if you have pmd and checkstyle configured in the reporting section of the pom.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jsfblog.info/2010/11/useful-eclipse-plugins/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Maven site generation error: DTDDVFactoryImpl does not extend from DTDDVFactory</title>
		<link>http://www.jsfblog.info/2010/04/maven-site-generation-error-dtddvfactoryimpl-does-not-extend-from-dtddvfactory/</link>
		<comments>http://www.jsfblog.info/2010/04/maven-site-generation-error-dtddvfactoryimpl-does-not-extend-from-dtddvfactory/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 11:35:01 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[maven-site-plugin]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[xerces]]></category>

		<guid isPermaLink="false">http://www.jsfblog.info/?p=197</guid>
		<description><![CDATA[When generating a site with Maven, we encountered the following exception when a particular reporting plugin was executed: This basically meant that an incompatible version of xerces was trying to be run. We have everything set to use Java 1.6, which ships with its own version of xerces. After some debugging, it was tracked down [...]]]></description>
			<content:encoded><![CDATA[<p>When generating a site with Maven, we encountered the following exception when a particular reporting plugin was executed:</p>
<pre class="brush: plain; title: ; notranslate">
org.apache.xerces.impl.dv.DVFactoryException:
DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.
</pre>
<p>This basically meant that an incompatible version of xerces was trying to be run. We have everything set to use Java 1.6, which ships with its own version of xerces. After some debugging, it was tracked down to the <a title="Maven Site Plugin" href="http://maven.apache.org/plugins/maven-site-plugin/">maven-site-plugin</a> which we had recently upgraded to use version 2.1 of the plugin by specifying it in our pom file like so:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;pluginManagement&gt;
	&lt;plugins&gt;
		&lt;plugin&gt;
			&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
			&lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
			&lt;version&gt;2.1&lt;/version&gt;
		&lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/pluginManagement&gt;
</pre>
<p>The maven-site-site plugin has the following dependency structure:</p>
<ul>
<li>org.apache.maven.plugins:maven-site-plugin:maven-plugin:2.1
<ul>
<li>org.apache.maven.doxia:doxia-module-xhtml:jar:1.1.2 (compile)
<ul>
<li>org.apache.maven.doxia:doxia-core:jar:1.1.2 (compile)
<ul>
<li>xerces:xercesImpl:jar:2.8.1 (compile)</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>It is the dependency of the xercesImpl jar 2.8.1 that is the problem. To get around this issue, you can tell the maven-site-plugin to exclude a particular dependency. This can be done like so:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;pluginManagement&gt;
	&lt;plugins&gt;
		&lt;plugin&gt;
			&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
			&lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
			&lt;version&gt;2.1&lt;/version&gt;
			&lt;dependencies&gt;
				&lt;dependency&gt;
					&lt;groupId&gt;org.apache.maven.doxia&lt;/groupId&gt;
					&lt;artifactId&gt;doxia-core&lt;/artifactId&gt;
					&lt;version&gt;1.1.2&lt;/version&gt;
					&lt;exclusions&gt;
						&lt;exclusion&gt;
							&lt;groupId&gt;xerces&lt;/groupId&gt;
							&lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
						&lt;/exclusion&gt;
					&lt;/exclusions&gt;
				&lt;/dependency&gt;
			&lt;/dependencies&gt;
		&lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/pluginManagement&gt;
</pre>
<p>There are a couple of maven reporting plugins that we found produced this exception when run with maven-site-plugin 2.1. These plugins are:</p>
<ul>
<li><a title="DocFlax XML Maven Plugin" href="http://www.filigris.com/downloads/view/docflex_xml/maven/index.html">DocFlex/XML Maven Plugin</a></li>
<li><a title="Canoo Webtest Maven Plugin" href="http://people.apache.org/~sgoeschl/download/maven-plugins/webtest-maven-plugin/site/index.html">Canoo Webtest Maven Plugin</a></li>
</ul>
<p>If you use an older version of the maven-site-plugin then the above mentioned reporting plugins should work ok. It is only when specifying a version of 2.1 or above that the exception occurs.</p>
<p>Some of the solutions suggested on the net didn&#8217;t work for us, like adding the xercesImpl jar as a dependency to the actual reporting plugin in question, so hopefully the solution mentioned in this post is helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jsfblog.info/2010/04/maven-site-generation-error-dtddvfactoryimpl-does-not-extend-from-dtddvfactory/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

