我的pom.xml
<?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>net.domain.testapp</groupId>
<artifactId>config</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>config</name>
<description></description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>spring</id>
<name>Spring Framework Maven Release Repository</name>
<url>https://repo.spring.io/release</url>
<layout>default</layout>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>central</id>
<name>Maven Central</name>
<url>https://repo1.maven.org/maven2</url>
<layout>default</layout>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>spring-plugin</id>
<name>Spring Framework Maven Release Repository</name>
<url>http://repo.spring.io/plugins-release</url>
<layout>default</layout>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>config</finalName>
</configuration>
</plugin>
</plugins>
</build>
</project>
我收到以下错误
96088 [DEBUG] Writing tracking file /builds/jigarshah/testapp/.m2/repository/javax-inject/javax-inject/1/javax-inject-1.pom.lastUpdated
96089 [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo1.maven.org/maven2
96089 [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo1.maven.org/maven2
96099 [DEBUG] Writing tracking file /builds/jigarshah/testapp/.m2/repository/javax-inject/javax-inject/1/javax-inject-1.pom.lastUpdated
96100 [DEBUG] Using transporter WagonTransporter with priority -1.0 for http://repo.spring.io/plugins-release
96100 [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://repo.spring.io/plugins-release
96507 [DEBUG] Writing tracking file /builds/jigarshah/testapp/.m2/repository/javax-inject/javax-inject/1/javax-inject-1.pom.lastUpdated
96514 [DEBUG] Skipped remote request for javax-inject:javax-inject:pom:1, already updated during this session.
96515 [DEBUG] Skipped remote request for javax-inject:javax-inject:pom:1, already updated during this session.
96515 [DEBUG] Skipped remote request for javax-inject:javax-inject:pom:1, already updated during this session.
96516 [WARNING] Unable to create Maven project for javax-inject:javax-inject:pom:1 from repository.
org.apache.maven.project.ProjectBuildingException: Error resolving project artifact: Failure to find javax-inject:javax-inject:pom:1 in https://repo.spring.io/release was cached in the local repository, resolution will not be reattempted until the update interval of spring has elapsed or updates are forced for project javax-inject:javax-inject:pom:1
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:355)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:236)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
我可以看到maven中心存在神器
https://repo1.maven.org/maven2/javax/inject/javax.inject/1/
为什么不解决?
答案 0 :(得分:0)
假设您的settings.xml中的代理设置正确(如果您可以从maven中心下载其他内容),那么您需要删除本地版本并强制它从maven central再次下载。
我建议:
1)删除家庭目录中的任何本地副本.m2 / repo / javax / inject / javax.inject
2)执行mvn clean install -U强制更新。