WSO2: failure to find org.apache.maven.plugins:maven-compiler-plugin.jar:3.2.3

4k Views Asked by At

I'm trying to run mvn clean install (on windows) and I'm getting the following error:

    [ERROR] Plugin org.apache.maven.plugins:maven-compiler-plugin:3.2.3 or one of its dependencies could not be resolved: Failure to find 
org.apache.maven.plugins:maven-compiler-plugin:jar:3.2.3 in http://dist.wso2.org
/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of wso2-maven2-repository-1 has elapsed or updates are forced -> [Help 1]

    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

Since this is the first project I'm working with maven, I have no idea how can I fix that...

Thanks!

1

There are 1 best solutions below

7
On BEST ANSWER

Check if you have no _maven.repositories or *.lastUpdated files in your repository in the directory .m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.2.3. If found then delete them.
Next you should remove reference to http://dist.wso2.org/maven2 in your pom.xml file and your settings.xml (in /home/.m2) file since the maven compiler plugin release 3.2.3 in not in this repository.
(Maven central repository is http://repo1.maven.org/maven2/). There I found the compiler plugin release 3.2. and it seems to be the latest release http://maven.apache.org/plugins/index.html.
Therefore if you use this repository change the version in your pom.xml to 3.2.
When done run you build again.

In the pom.xml you ca set the plugin release in the <pluginManagement> section:

  <project>
    ...
    <build>
      ...
      <pluginManagement>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
          </plugin>
        </plugins>
       </pluginManagement>
     </build>
   </project>

And here below a minimal settings.xml to start working with maven central repository (change ${unsername} with your own):

<settings>
  <localRepository>C:\Users\${username}\.m2\repository</localRepository>
    <repositories>
      <repository>   
        <releases>
          <enabled>true</enabled>
        </releases>
        <snapshots>
          <enabled>true</enabled>
        </snapshots>  
        <id>central</id>
        <name>central repository</name>
        <url>http://repo1.maven.org/maven2</url>      
      </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <id>central</id>
          <name>central repository</name>
          <url>http://repo1.maven.org/maven2</url>
        </pluginRepository>
      </pluginRepositories>
    </settings>