首页 > 代码库 > Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins问题的解决

Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins问题的解决

今天换了个maven仓库,结果新建maven工程的时候,忽然报错:

Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins...

在网上面找了很多种解决方案,都无济于事,后来在stackoverflow上看到一个靠谱的:

直接在pom.xml中增添如下代码即可:

<build>
    <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
    </plugins>
</build>

以后还是直接去stackoverflow搜索问题比较好,看些乱七八糟互相抄袭的博客/百度知道,果然还是前者比较高效

 

Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins问题的解决