An internal error occurred during: “Updating Maven Project”. java.lang.NullPointerException

后端 未结 20 766
小鲜肉
小鲜肉 2020-12-12 16:55

I\'m developing a Java EE web project. When I try to add a dependency, this error message appears. I use Eclipse Kepler.

An internal error occurred du

相关标签:
20条回答
  • 2020-12-12 17:24

    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>
    
    0 讨论(0)
  • 2020-12-12 17:25

    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.

    0 讨论(0)
  • 2020-12-12 17:26

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

    0 讨论(0)
  • 2020-12-12 17:26

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

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

    0 讨论(0)
  • 2020-12-12 17:29

    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
    0 讨论(0)
  • 2020-12-12 17:29

    deleting the local maven repository helped me

    0 讨论(0)
提交回复
热议问题