我收到以下异常。我正在使用intellij 2017,Ultimate版本,Nexus OSS版本3,Maven和&春季启动。在之前的项目中,我使用的是Gradle,它似乎运行良好,但是当我在maven中尝试基于教程的Spring-Boot项目时,我就遇到了这样的异常。我不明白为什么。
sean@sean-PC:/dev_0/proj/idea/spring/spring-data-jpa/spring-core-spring-mvc$ mvn package -X
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T18:41:47+02:00)
Maven home: /dev_0/app/mvn
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /dev_0/app/jdk/jre
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "4.8.0-46-generic", arch: "amd64", family: "unix"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: ** Other stuff {Deleted to prevent Clutter}**
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /dev_0/app/mvn/conf/settings.xml
[DEBUG] Reading user settings from /home/sean/.m2/settings.xml
[DEBUG] Reading global toolchains from /dev_0/app/mvn/conf/toolchains.xml
[DEBUG] Reading user toolchains from /home/sean/.m2/toolchains.xml
[DEBUG] Using local repository at /dev_0/repo
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /dev_0/repo
[INFO] Scanning for projects...
[DEBUG] Using mirror feature (http://localhost:8081/repository/feature/) for master (http://localhost:8081/repository/master/).
[DEBUG] Using mirror feature (http://localhost:8081/repository/feature/) for hotfix (http://localhost:8081/repository/hotfix/).
[DEBUG] Using mirror feature (http://localhost:8081/repository/feature/) for release (http://localhost:8081/repository/release/).
[DEBUG] Using mirror feature (http://localhost:8081/repository/feature/) for develop (http://localhost:8081/repository/develop/).
[DEBUG] Using mirror feature (http://localhost:8081/repository/feature/) for feature (http://localhost:8081/repository/feature/).
[DEBUG] Using mirror feature (http://localhost:8081/repository/feature/) for central (https://repo.maven.apache.org/maven2).
[DEBUG] Extension realms for project guru.springframework:springmvc:jar:0.0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
[DEBUG] Extension realms for project org.springframework.boot:spring-boot-starter-parent:pom:1.3.0.RELEASE: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Extension realms for project org.springframework.boot:spring-boot-dependencies:pom:1.3.0.RELEASE: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: guru.springframework:springmvc:jar:0.0.1-SNAPSHOT
[DEBUG] Tasks: [package]
[DEBUG] Style: Regular
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building springmvc 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://localhost:8081/repository/feature/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://localhost:8081/repository/feature/ with username=sean, password=***
Downloading: http://localhost:8081/repository/feature/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[DEBUG] Writing tracking file /dev_0/repo/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom.lastUpdated
[WARNING] The POM for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 is missing, no dependency information available
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://localhost:8081/repository/feature/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://localhost:8081/repository/feature/ with username=sean, password=***
Downloading: http://localhost:8081/repository/feature/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar
[DEBUG] Writing tracking file /dev_0/repo/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.342 s
[INFO] Finished at: 2017-04-09T08:27:50+02:00
[INFO] Final Memory: 13M/292M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-resources-plugin:jar:2.6 in feature (http://localhost:8081/repository/feature/) -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-resources-plugin:jar:2.6 in feature (http://localhost:8081/repository/feature/)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:128)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:179)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:284)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:241)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:169)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:155)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:131)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:145)
at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:109)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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:498)
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.apache.maven.plugins:maven-resources-plugin:jar:2.6 in feature (http://localhost:8081/repository/feature/)
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:124)
... 26 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.maven.plugins:maven-resources-plugin:jar:2.6 in feature (http://localhost:8081/repository/feature/)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:39)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
... 30 more
[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/PluginResolutionException
这是我的POM文件:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>guru.springframework</groupId>
<artifactId>springmvc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>springmvc</name>
<description>Demo project for Spring
Boot</description>
<!-- download artifacts from this repo -->
<repositories>
<repository>
<id>feature</id>
<name>Feature Plugin Repository</name>
<url>http://localhost:8081/repository/feature/</url>
<releases>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>feature</id>
<name>Feature Plugin Repository</name>
<url>http://localhost:8081/repository/feature/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<updatePolicy>always</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-maven-plugin -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>
<!--<!– https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools –>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!--WebJars-->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.5</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>2.1.4</version>
</dependency>
<!--encryption lib-->
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
&安培;这是我的settings.xml文件:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>/dev_0/repo</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>feature</id>
<username>sean</username>
<password>****</password>
</server>
<server>
<id>develop</id>
<username>sean</username>
<password>****</password>
</server>
<server>
<id>hotfix</id>
<username>sean</username>
<password>*****</password>
</server>
<server>
<id>release</id>
<username>sean</username>
<password>****</password>
</server>
<server>
<id>master</id>
<username>sean</username>
<password>****</password>
</server>
</servers>
<mirrors>
<mirror>
<id>feature</id>
<mirrorOf>*</mirrorOf>
<name>feature</name>
<url>http://localhost:8081/repository/feature/</url>
</mirror>
<mirror>
<id>develop</id>
<mirrorOf>external:*</mirrorOf>
<name>develop</name>
<url>http://localhost:8081/repository/develop/</url>
</mirror>
<mirror>
<id>release</id>
<mirrorOf>external:*</mirrorOf>
<name>release</name>
<url>http://localhost:8081/repository/release/</url>
</mirror>
<mirror>
<id>hotfix</id>
<mirrorOf>external:*</mirrorOf>
<name>hotfix</name>
<url>http://localhost:8081/repository/hotfix/</url>
</mirror>
<mirror>
<id>master</id>
<mirrorOf>external:*</mirrorOf>
<name>master</name>
<url>http://localhost:8081/repository/master/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>feature</id>
<repositories>
<repository>
<id>feature</id>
<name>Feature Repo for feature-builds</name>
<url>http://localhost:8081/repository/feature/</url>
<layout>default</layout>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>develop</id>
<repositories>
<repository>
<id>develop</id>
<name>Develop Repo for develop-builds</name>
<url>http://localhost:8081/repository/develop/</url>
<layout>default</layout>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>release</id>
<repositories>
<repository>
<id>release</id>
<name>Release Repo for release-builds</name>
<url>http://localhost:8081/repository/release/</url>
<layout>default</layout>
<releases><enabled>true</enabled></releases>
<!-- <snapshots><enabled>true</enabled></snapshots> -->
</repository>
</repositories>
</profile>
<profile>
<id>hotfix</id>
<repositories>
<repository>
<id>hotfix</id>
<name>Hotfix Repo for hotfix-builds</name>
<url>http://localhost:8081/repository/hotfix/</url>
<layout>default</layout>
<releases><enabled>true</enabled></releases>
<!-- <snapshots><enabled>true</enabled></snapshots> -->
</repository>
</repositories>
</profile>
<profile>
<id>master</id>
<repositories>
<repository>
<id>master</id>
<name>Master Repo for master-builds</name>
<url>http://localhost:8081/repository/master/</url>
<layout>default</layout>
<releases><enabled>true</enabled></releases>
<!-- <snapshots><enabled>true</enabled></snapshots> -->
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>feature</activeProfile>
<activeProfile>develop</activeProfile>
<activeProfile>release</activeProfile>
<activeProfile>hotfix</activeProfile>
<activeProfile>master</activeProfile>
</activeProfiles>
</settings>
我错过了什么?
另一个构建尝试的堆栈跟踪:
[INFO] Building springmvc 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://localhost:8081/repository/feature/org/springframework/boot/spring-boot-maven-plugin/1.3.0.RELEASE/spring-boot-maven-plugin-1.3.0.RELEASE.pom
[WARNING] The POM for org.springframework.boot:spring-boot-maven-plugin:jar:1.3.0.RELEASE is missing, no dependency information available
Downloading: http://localhost:8081/repository/feature/org/springframework/boot/spring-boot-maven-plugin/1.3.0.RELEASE/spring-boot-maven-plugin-1.3.0.RELEASE.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.336 s
[INFO] Finished at: 2017-04-09T08:49:39+02:00
[INFO] Final Memory: 11M/292M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:1.3.0.RELEASE or one of its dependencies could not be resolved: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:1.3.0.RELEASE in feature (http://localhost:8081/repository/feature/) -> [Help 1]
[ERROR]