插件org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT或其中一个依赖项无法解析

时间:2023-01-14 08:58:35

I am getting below error:

我收到以下错误:

Plugin org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:1.3.0.BUILD-SNAPSHOT

插件org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT或其中一个依赖项无法解析:找不到工件org.springframework.boot:spring-boot-maven-plugin:罐子:1.3.0.BUILD-快照

My pom.xml file is:

我的pom.xml文件是:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.BBMSearchApp</groupId>
  <artifactId>adder</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>adder Maven Webapp</name>
  <url>http://maven.apache.org</url>
  
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.3.0.BUILD-SNAPSHOT</version>
	</parent>
  
  	<dependencies>
  		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<!-- <dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-mongodb</artifactId>
			<version>1.7.0.RELEASE</version>
		</dependency>
 -->
		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
        </dependency>
		
		<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>springloaded</artifactId> 
        </dependency>
        <!-- <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j</artifactId> 
        </dependency> -->
		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
   			<groupId>org.apache.tomcat.embed</groupId>
   			<artifactId>tomcat-embed-jasper</artifactId>
   			<scope>provided</scope>
		</dependency>
		
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20141113</version>
		</dependency>
		
		<dependency>  
      		<groupId>joda-time</groupId>  
      		<artifactId>joda-time</artifactId>  
		</dependency>
        
		<dependency>
        	<groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <!-- <dependency>
        	<groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-social-facebook</artifactId>
        </dependency> -->

        <!-- <dependency>
        	<groupId>org.neo4j</groupId>
        	<artifactId>neo4j-cypher-compiler-2.1</artifactId>
        	<version>2.1.5</version>
        </dependency> -->
        <dependency>
        	<groupId>org.scala-lang</groupId>
        	<artifactId>scala-library</artifactId>
        	<version>2.10.4</version>
        </dependency>
        <dependency>
    		<groupId>org.codehaus.jackson</groupId>
    		<artifactId>jackson-core-asl</artifactId>
		    <version>1.9.13</version>
		</dependency>

		<dependency>
    		<groupId>org.codehaus.jackson</groupId>
    		<artifactId>jackson-mapper-asl</artifactId>
    		<version>1.9.13</version>
		</dependency>

		<!-- <dependency>
			<groupId>org.neo4j</groupId>
			<artifactId>neo4j-cypher-compiler-2.1</artifactId>
			<version>2.1.5</version>
		</dependency> -->
		
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-s3</artifactId>
			<version>1.9.30</version>
		</dependency>
		
  	</dependencies>
  	
  	<build>
    	<finalName>adder</finalName>
	
		<plugins>
    	    <plugin>
	            <artifactId>maven-compiler-plugin</artifactId>
    	        <configuration>
        	        <source>1.8</source>
            	    <target>1.8</target>
            	</configuration>
        	</plugin>

		</plugins>
	</build>
	<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>http://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>


	
</project>

And debug logs are:

调试日志是:

Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T22:59:23+05:30)
Maven home: C:\Dev\apache-maven-withCustomReposiory\apache-maven-3.2.5
Java version: 1.8.0_11, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_11\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "dos"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\Dev\apache-maven-withCustomReposiory\apache-maven-3.2.5\conf\settings.xml
[DEBUG] Reading user settings from C:\Dev\apache-maven-withCustomReposiory\apache-maven-3.2.5\conf\settings.xml
[DEBUG] Using local repository at C:\Users\DK\.m2Custom\repo
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\Users\DK\.m2Custom\repo
[INFO] Scanning for projects...
[DEBUG] Could not find metadata org.springframework.boot:spring-boot-starter-parent:1.3.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.springframework.boot:spring-boot-starter-parent:1.3.0.BUILD-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata org.springframework.boot:spring-boot-dependencies:1.3.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.springframework.boot:spring-boot-dependencies:1.3.0.BUILD-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Extension realms for project com.BBMSearchApp:adder:war:0.0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging war from ClassRealm[plexus.core, parent: null]
[DEBUG] Could not find metadata org.springframework:spring-framework-bom:4.2.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.springframework:spring-framework-bom:4.2.0.BUILD-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata org.springframework.integration:spring-integration-bom:4.2.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.springframework.integration:spring-integration-bom:4.2.0.BUILD-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Extension realms for project org.springframework.boot:spring-boot-starter-parent:pom:1.3.0.BUILD-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Could not find metadata org.springframework:spring-framework-bom:4.2.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.springframework:spring-framework-bom:4.2.0.BUILD-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata org.springframework.integration:spring-integration-bom:4.2.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.springframework.integration:spring-integration-bom:4.2.0.BUILD-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata org.springframework.boot:spring-boot-dependencies:1.3.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.springframework.boot:spring-boot-dependencies:1.3.0.BUILD-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Extension realms for project org.springframework.boot:spring-boot-dependencies:pom:1.3.0.BUILD-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Resolving plugin prefix spring-boot from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Could not find metadata org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Could not find metadata org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[WARNING] The POM for org.springframework.boot:spring-boot-maven-plugin:jar:1.3.0.BUILD-SNAPSHOT is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT: Plugin org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:1.3.0.BUILD-SNAPSHOT
org.apache.maven.plugin.PluginResolutionException: Plugin org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:1.3.0.BUILD-SNAPSHOT
	at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:133)
	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:150)
	at org.apache.maven.plugin.DefaultBuildPluginManager.loadPlugin(DefaultBuildPluginManager.java:81)
	at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolveFromProject(DefaultPluginPrefixResolver.java:138)
	at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolveFromProject(DefaultPluginPrefixResolver.java:125)
	at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:85)
	at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:260)
	at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:220)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:85)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:1.3.0.BUILD-SNAPSHOT
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
	at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
	... 24 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:1.3.0.BUILD-SNAPSHOT
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:434)
	... 28 more
[DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.apache.maven.plugins/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (C:\Users\DK\.m2Custom\repo)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 4.8 KB/sec)
[DEBUG] Writing tracking file C:\Users\DK\.m2Custom\repo\org\apache\maven\plugins\resolver-status.properties
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 6.9 KB/sec)
[DEBUG] Writing tracking file C:\Users\DK\.m2Custom\repo\org\codehaus\mojo\resolver-status.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.313 s
[INFO] Finished at: 2015-05-02T23:05:55+05:30
[INFO] Final Memory: 15M/208M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\DK\.m2Custom\repo), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\DK\.m2Custom\repo), central (https://repo.maven.apache.org/maven2)]
	at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:93)
	at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:260)
	at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:220)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:85)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

2 个解决方案

#1


Add the version part,it works for me

添加版本部分,它适合我

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>1.2.7.RELEASE</version>
        </plugin>
    </plugins>
</build>

#2


You must add following excerpt to pom.xml for compiling with SNAPSHOTS and MILESTONES:

您必须将以下摘录添加到pom.xml以便使用SNAPSHOTS和MILESTONES进行编译:

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
            <snapshots><enabled>true</enabled></snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
         </pluginRepository>
    </pluginRepositories>

#1


Add the version part,it works for me

添加版本部分,它适合我

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>1.2.7.RELEASE</version>
        </plugin>
    </plugins>
</build>

#2


You must add following excerpt to pom.xml for compiling with SNAPSHOTS and MILESTONES:

您必须将以下摘录添加到pom.xml以便使用SNAPSHOTS和MILESTONES进行编译:

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
            <snapshots><enabled>true</enabled></snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
         </pluginRepository>
    </pluginRepositories>