【[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist】解决方案

苏高旻
2023-12-01
在刚刚使用maven创建项目的时候,遇到

[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be fo......

一连串的报错信息,项目生成失败,通过与别人的项目对比发现有好多插件缺失,然后找原因,最后通过配置maven路径下conf下的setting.xml文件来解决此问题。


解决方案:更改两处地方,mirrors和profile两个标签中的内容改为:

mirrors部分:
<mirrors>	
<mirror>
        <id>nexus-osc</id>
        <mirrorOf>central</mirrorOf>
        <name>Nexus osc</name>
        <url>http://maven.oschina.net/content/groups/public/</url>
    </mirror>
    <mirror>
        <id>nexus-osc-thirdparty</id>
        <mirrorOf>thirdparty</mirrorOf>
        <name>Nexus osc thirdparty</name>
        <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
    </mirror>

  </mirrors>


profiles部分:
	<profiles><id>jdk-1.4</id>

                <activation>
                    <jdk>1.4</jdk>
                </activation>

                <repositories>
                    <repository>
                        <id>nexus</id>
                        <name>local private nexus</name>
                        <url>http://maven.oschina.net/content/groups/public/</url>
                        <releases>
                            <enabled>true</enabled>
                        </releases>
                        <snapshots>
                            <enabled>false</enabled>
                        </snapshots>
                    </repository>
                </repositories>
                <pluginRepositories>
                    <pluginRepository>
                        <id>nexus</id>
                        <name>local private nexus</name>
                        <url>http://maven.oschina.net/content/groups/public/</url>
                        <releases>
                            <enabled>true</enabled>
                        </releases>
                        <snapshots>
                            <enabled>false</enabled>
                        </snapshots>
                    </pluginRepository>
                </pluginRepositories>
  </profiles>


 类似资料: