【发布时间】:2021-09-11 05:52:39
【问题描述】:
上下文:Maven-Server 是一个 AMI 实例,Artifactory 也在另一个 AMI 实例上。 尝试将 Maven 工件从 Maven-server AMI 部署到 Artifactory AMI。
问题:由于 maven-default-http-blocker (http://0.0.0.0/),无法部署工件。
堆栈跟踪
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.example:sprhava:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.
boot:spring-boot-starter-parent:pom:2.5.4 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for reposit
ories: [central (http://ec2-public-ipaddress:8082/artifactory/maven-libs-release, default, releases), snapshots (http://ec2-public-ipaddress:8082/artifactory/maven-libs-snapshot, default, releases+snapshots)] and 'parent.relativePath' points at no local POM.
settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd" xmlns
="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>admin</username>
<password>Helloadmin123</password>
<id>central</id>
</server>
<server>
<username>admin</username>
<password>Helloadmin123</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<mirrors>
<mirror>
<id>central</id>
<url>http://ec2-public-ipaddress:8082/artifactory/sprhava-libs-release</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<mirrors>
<mirror>
<id>snapshots</id>
<url>http://ec2-public-ipaddress:8082/artifactory/sprhava-libs-snapshot</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>sprhava-libs-release</name>
<url>http://ec2-public-ipaddress:8082/artifactory/sprhava-libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>sprhava-libs-snapshot</name>
<url>http://ec2-public-ipaddress:8082/artifactory/sprhava-libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>sprhava-libs-release</name>
<url>http://ec2-public-ipaddress:8082/artifactory/sprhava-libs-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>sprhava-libs-snapshot</name>
<url>http://ec2-public-ipaddress:8082/artifactory/sprhava-libs-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfile>
</settings>
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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>maven</name>
<description>DevOps CI/CD project </description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<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-starter-tomcat</artifactId>
<scope>provided</scope>
</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-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>central</id>
<name>ip-ec2-ipaddress.compute.internal-releases</name>
<url>http://ec2-public-ipaddress:8082/artifactory/maven-libs-release</url>
</repository>
</distributionManagement>
从过去四天开始,我正在尝试解决此问题,并尝试检查 Artifactory 安全组: Artifactory-SG 我不确定我哪里出错了。任何线索将不胜感激。
【问题讨论】:
-
settings.xml 使用相同的 maven 构建工件部署在工件上
-
你可以使用哪个
ide -
我猜这个问题是由于 Maven 3.8.x 默认阻塞了 http 存储库。
标签: amazon-web-services spring-boot maven jfrog