16

I'm having some issues to configure properly my eclipse to work with maven.

I create a new project, this one is correctly build with maven in command line (mvn install), but in Eclipse I got this error:

CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 (): ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-settings:jar:2.2.1: ArtifactResolutionException: Failure to transfer org.apache.maven:maven-settings:pom:2.2.1 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-settings:pom:2.2.1 from/to central : NullPointerException pom.xml /test line 9 Maven Project Build Lifecycle Mapping Problem

Here is my settings.xml conf :

<proxy>
  <active>true</active>
  <protocol>http</protocol>
  <username>myuser</username>
  <password>$mymdp</password>
  <host>myhost</host>
  <port>8080</port>
  <nonProxyHosts>some.host.com</nonProxyHosts>
</proxy>
....

<repository>
     <id>central</id>
     <name>central repo m2</name>
     <url>http://central.maven.org/maven2</url>
</repository>

I choose the correct maven installation (in Preference -> Maven -> Install)

I also direct my user settings on the correct settings.xml (Preferences -> Maven -> User Settings)

But I still got this error in Eclipse and everything goes well with maven command line. Do you have and idea?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
user3275313
  • 186
  • 1
  • 1
  • 6

7 Answers7

13

You only need to delete one folder it is throwing error for. Just go to your M2 repo and org/apache/maven/plugins/maven-compiler-plugins and delete the folder 2.3.2

Mahaveer Jangir
  • 597
  • 7
  • 15
10

Have you tried to remove the proxy username and password? A similar poster encountered that issue:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-jar-plugin:2.3.2 or one of its dependencies could not be resolved

Failing that I found the following worked:

  1. Delete project in Eclipse (but do not delete the contents on disk)
  2. Delete all files in your Maven repository
  3. Re-download all Maven dependencies:

mvn dependency:resolve

  1. Start up Eclipse
  2. Ensure that Eclipse is configured to use your external Maven installation (Window->Preferences->Maven->Installations)
  3. Re-import the existing project(s) into Eclipse
  4. Ensure that there are no Maven Eclipse plugin errors on the final screen of the project import
Community
  • 1
  • 1
Conor Svensson
  • 1,151
  • 11
  • 17
  • I am having the same issue. Tried almost every possible way mentioned in stackoverflow, still unable to resolve the issue. Can you please help. I am getting this error: "Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6" and somewhere I also see "Unrecognized SSL message, plaintext connection?" – Sahil Chhabra Apr 17 '16 at 09:37
3

I was getting this problem when using IBM RSA 9.6.1 when building a brand new development machine. The problem for me ended up being because of HTTPS on the Global Maven repository. My solution was to create a Maven settings.xml that forced it to use HTTP.

The key to me was that the central repository was empty when I exploded it under Maven Repositories -- > Global Repositories

Using the following settings file worked for me:

<settings>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>insecurecentral</activeProfile>
  </activeProfiles>
  <profiles>
    <profile>
      <id>insecurecentral</id>
      <!--Override the repository (and pluginRepository) "central" from the Maven Super POM -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://repo.maven.apache.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://repo.maven.apache.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
</settings>

I got the idea from this stackoverflow question.

Garet Jax
  • 1,091
  • 3
  • 17
  • 37
1

The issue has been resolved while installation of the maven settings is provided as External in Eclipse. The navigation settings are Window --> Preferences --> Installations. Select the External as installation Type, provide the Installation home and name and click on Finish. Finally select this as default installations.

Fizal Haji
  • 11
  • 1
1

I accidentally turned on offline mode.

To disable it: in the Maven tool window, click The Toggle Offline Mode button.

enter image description here

parsecer
  • 4,758
  • 13
  • 71
  • 140
1

Find your Maven local repository, navigate to maven-compiler-plugin, delete the 3.8.1 folder, so that the Maven will redownload it again.

For example: C:\Users\mkyong.m2\repository\org\apache\maven\plugins\maven-compiler-plugin

Ramesh Korla
  • 64
  • 2
  • 3
  • 8
0

I also got the same issue and not able to create a jar, and I found that in Windows-->Prefernces-->Java-->installed JREs By default JRE was added to the build path of newly created java project so just changed it to your prefered JDK.

Shivam Patil
  • 48
  • 10