Note that there are some explanatory texts on larger screens.

plurals
  1. POmaven-compiler-plugin won't upgrade from 2.0.2.SP1 to 2.3.2
    text
    copied!<p>I'm a Maven newbie, have been studying Maven for a week now, have 5 years experience using Ant, so I'm able to come up to speed without trouble. I have read through all documentation at maven.apache.org twice -- several hundred pages of reading. I have created several test apps using several different Maven archetypes to better my understanding as I've read through the documentation. Now, I'm setting up my new project and the finer points are coming into play...</p> <p>I think I know why the maven-compiler-plugin won't upgrade to the latest release, 2.3.2, when I run</p> <pre><code>mvn versions:use-latest-release </code></pre> <p>but I need to know if there is a workaround, or if I should even be concerned. First, here's a snip of my pom.xml:</p> <pre><code> &lt;plugin&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;version&gt;2.3.2&lt;/version&gt; &lt;configuration&gt; &lt;source&gt;1.5&lt;/source&gt; &lt;target&gt;1.5&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre> <p>As you can see I am specifying version 2.3.2. Thinking there might be a problem with Maven not knowing it needed to update its files in the repository, I ran mvn versions:use-latest-releases I noticed that the jar file was downloaded into ~/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/ i.e.</p> <pre><code>ll ~/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.3.2 total 60 -rw-rw-r--. 1 pgarner pgarner 29176 Oct 7 21:29 maven-compiler-plugin-2.3.2.jar -rw-rw-r--. 1 pgarner pgarner 335 Oct 7 21:29 maven-compiler-plugin-2.3.2.jar.lastUpdated -rw-rw-r--. 1 pgarner pgarner 40 Oct 7 21:29 maven-compiler-plugin-2.3.2.jar.sha1 -rw-rw-r--. 1 pgarner pgarner 7329 Oct 7 21:29 maven-compiler-plugin-2.3.2.pom -rw-rw-r--. 1 pgarner pgarner 335 Oct 7 21:29 maven-compiler-plugin-2.3.2.pom.lastUpdated -rw-rw-r--. 1 pgarner pgarner 40 Oct 7 21:29 maven-compiler-plugin-2.3.2.pom.sha1 -rw-rw-r--. 1 pgarner pgarner 208 Oct 7 21:29 _maven.repositories </code></pre> <p>But when I ran the following it was evident that the maven-compiler-plugin version remained as 2.0.2.SP1:</p> <pre><code>mvn help:describe -Dplugin=org.apache.maven.plugins:maven-compiler-plugin /usr/java/jdk1.7.0 [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building RichFaces 4 Application 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-help-plugin:2.1.1:describe (default-cli) @ Patrac --- [INFO] org.apache.maven.plugins:maven-compiler-plugin:2.0.2.SP1 Name: Maven Compiler Plugin Description: Maven Plugins Group Id: org.apache.maven.plugins Artifact Id: maven-compiler-plugin Version: 2.0.2.SP1 Goal Prefix: compiler </code></pre> <p>Noting that I did use the richfaces-archetype-simpleapp archetype to generate this project, and that I was required to add the JBoss repository to the project, my next thought was that there might have been something in RichFaces that prevented the project from using the latest compiler, I took a look at</p> <p>~/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata-jboss-public-repository-group.xml</p> <p>and sure enough there, I think, I found the problem:</p> <pre><code>&lt;latest&gt;2.4-SNAPSHOT&lt;/latest&gt; &lt;release&gt;2.0.2.SP1&lt;/release&gt; &lt;versions&gt; &lt;version&gt;0.1-stub-SNAPSHOT&lt;/version&gt; &lt;version&gt;2.0.2.SP1&lt;/version&gt; &lt;version&gt;2.3.2-SNAPSHOT&lt;/version&gt; &lt;version&gt;2.4-SNAPSHOT&lt;/version&gt; &lt;/versions&gt; </code></pre> <p>So, does this mean that RichFaces cannot be used with maven-compiler-plugin version 2.3.2?</p> <p>I would like to get started on this new project using the latest version of maven-compiler-plugin. I would like to stay away from using snapshots and stick with releases. My instinct tells me that it would be completely dangerous to add an entry for version 2.3.2 to the above XML file i.e. 2.3.2. Am I correct? Or is this simply a matter of the JBoss-Maven repository not having a complete set of all the versions of the maven-compiler-plugin?</p> <p>What are my options? Should I just be satisfied with using v. 2.0.2.SP1? Or is there a way to ask Maven to ignore maven-metadata-jboss-public-repository-group.xml, or perhaps ask Maven to give precedence to the Maven Central repository over the JBoss repository?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload