score:164

Accepted answer

i solved mine by deleting the .settings folder and .project file in the project and then reimporting the project.

score:0

i had the same problem. none of the solutions here worked. i had to completely reinstall eclipse and make a new workspace. then it worked!

score:0

i had this same issue across multiple projects and multiple workspaces, none of the solutions i found online worked for me. i'm using sts and the only thing that worked was to go into my sts directory and add a "-clean" to the top of the sts.ini file. you can then start up your workspace and run maven clean without errors. (you can also remove the -clean tag from the ini file so it doesn't clean everytime you start it)

hope this helps someone.

score:0

the root issue in my case was a file conflict in the .settings folder. so, deleting the .settings folder would have resolved the maven error, but i wanted to keep some of my local configuration files. i resolved the conflict, then tried a maven update again and it worked.

score:0

i had the same issue ... solution at the end !

here the eclipse log:

java.lang.nullpointerexception
    at com.google.appengine.eclipse.wtp.maven.gaeruntimemanager.getgaeruntime(gaeruntimemanager.java:85)
    at com.google.appengine.eclipse.wtp.maven.gaeruntimemanager.ensuregaeruntimewithsdk(gaeruntimemanager.java:55)
    at com.google.appengine.eclipse.wtp.maven.gaefacetmanager.addgaefacet(gaefacetmanager.java:59)
    at com.google.appengine.eclipse.wtp.maven.gaeprojectconfigurator.configure(gaeprojectconfigurator.java:46)

... it comes from "appengine maven wtp plugin" that try to get the type of gae runtime, but seems to be null here (... getruntimetype() --> npe):

see class com.google.appengine.eclipse.wtp.maven/gaeruntimemanager.java

  private static iruntime getgaeruntime(string sdkversion) {
    iruntime[] runtimes = servercore.getruntimes();
    for (iruntime runtime : runtimes) {
      if (runtime != null &&  **runtime.getruntimetype()**.equals(gae_runtime_type)) {

so, if you check in eclipse, google app engine is visible , but when you select it you'll see that no sdk is associated ... preference/server/runtime environments

solution: in red on the screenshot ;-)

score:0

i encountered this same symptom and none of the solutions above were helpful. i finally got a stack trace of the problem by importing the ear project again to eclipse, and was able to trace this down to the org.eclipse.m2e.wtp.mavendeploymentdescriptormanagement which was trying to delete a directory in windows' temp directory called ".mavendeploymentdescriptormanagement", which caused an irrational nullpointerexception from the java.io.file.exists() method, particularly because the code already had successfully done the same thing in a previous method with the same variable, then called file.isfile() without problem.

checking this out on the file system revealed that the file could only be accessed with administrator privileges. apparently i had at some point launched eclipse from an administrator console by mistake. in the end i just made hidden files visible in windows explorer and deleted the temporary file manually, which solved the problem.

score:0

just another possible source of the problem!

i found out that in my case it was the following resource block that caused it:

<project>
    <build>
        <resources>
            <resource>
                <directory>${basedir}/../some-folder</directory>
                <targetpath>outputfolder</targetpath>
            </resource>
        <resources>
    </build>
</project>

it included a folder from the project folder (the eclipse project is a subfolder of the versioned project folder).

in my case, i could remove the error by removing the block and replacing it with a call to the build helper maven plugin:

<build>
    <plugins>
        <plugin>
            <groupid>org.codehaus.mojo</groupid>
            <artifactid>build-helper-maven-plugin</artifactid>
            <version>1.9.1</version>
            <executions>
                <execution>
                    <id>my-own-very-cool-id-for-this-step</id>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>add-resource</goal>
                    </goals>
                    <configuration>
                        <resources>
                            <resource>
                                <directory>${basedir}/../some-folder</directory>
                                <targetpath>outputfolder</targetpath>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

score:0

i had to reinstall eclipse, delete .m2 folder and rebuild the jars.

score:0

deleting the local maven repository helped me

score:0

in my case, the problem was a conflict of derived dependencies that were been used by other dependencies, and some of those derived dependencies versions were not available, maybe because some deploy that i forgot to do because with workspace resolution everything worked, but when moving to other environment all broke suddenly. and also i was working with version ranges

maven was giving me this error:

could not resolve dependencies for project myproject:myproject:jar:1.0.0: could not resolve version conflict among dependency-a:1.0.1 -> dependency-b:1.1.0 -> dependency-c:1.0.0, dependency-x:1.0.1 -> dependency-y:1.1.0 -> dependency-c:1.0.0, dependency-i:1.0.1 -> dependency-j:1.1.0 -> dependency-c:1.0.0

i tried all above and nothing worked, so...

the solution: use latest as version in all dependencies, so maven don't need to resolve all dependencies in ranges, wich must be used with care because if you miss to deploy one of the dependencies the build will fail

only i suggest you to use latest if you are working with your own dependencies, otherwise in some third party future version, you could find some compilation or runtime errors

score:0

avoid deleting the .metadata folder as it cleans up all settings, run configurations. instead, rename the .metadata folder --> restart eclipse --> import project

score:1

org.eclipse.m2e.core.prefs file is in .settings folder. if you face the problem of

an internal error occurred during: "updating maven project". java.lang.nullpointerexception

delete the project from eclipse then by deleting the .settings folder & .project file in the project -> then re-import the project.

score:1

none of the above methods worked for me. this might also arise due to the presence of circular dependency in your eclipse workspace. so if there are any other errors present in any of the other projects in your workspace, try to fix those and then this issue will be gone. this is how i eliminated the error.

score:1

this helped me: project menu -> clean... -> clean all projects

score:1

eclipse has an error log. there you will see the complete stack trace. in my case it seems to be caused by a bad jar file combined with the java.util.zip libs not throwing a proper exception, just a nullpointerexception.

score:1

i'm using:

eclipse java ee ide for web developers.

version: neon.3 release (4.6.3) build id: 20170314-1500

the fix/trick for me was deleting my local repository in ~/.m2/repository in order to remove local dependencies and rebuilding my project in which fresh dependencies are pulled down.

score:1

above solutions did not work for me as the issue with open jdk 13 version https://github.com/spotify/dockerfile-maven/issues/163 so i degraded to open jdk8 and it works for me

score:3

in case it helps anyone, in addition to deleting .settings and .project, i had to delete .classpath and .factorypath before being able to import the project successfully into eclipse.

score:3

in our instance of this problem, we had pom.xml files where the m2e-specific life cycle mapping configuration

<pluginmanagement>
    <plugins>
        <plugin>
            <groupid>org.eclipse.m2e</groupid>
            <artifactid>lifecycle-mapping</artifactid>
            <version>1.0.0</version>
            <configuration>
                <lifecyclemappingmetadata>
...

did not have the <version>1.0.0</version> part. when doing a maven -> update project..., this causes the reported nullpointerexception without a stack trace. when using a fresh import... -> existing maven projects, the same exception occurred, but with a stack trace that led me to find the above.

(this is with m2e 1.6.1.20150625-2338 in eclipse luna service release 2 (4.4.2).)

score:7

i've had the same problem in one of my modules.

running "mvn eclipse:eclipse" in the console/cmd solved the problem for me.

score:25

for me worked the answer i found on coderanch, by user maneesh godbole:

  1. close eclipse.
  2. navigate to your "workspace" folder
  3. ensure the setting on your os to view hidden files is turned on
  4. identify and delete the .metadata directory
  5. restart eclipse
  6. import project

Related Query

More Query from same tag