Maven : 저장소 요소가 distributionManagement 내부의 POM에 지정되지 않았습니다.
명령을 실행하려고하는데이 mvn release:perform
오류가 발생합니다.
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project git-demo: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
내 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.sonatype.blog</groupId>
<artifactId>git-demo</artifactId>
<packaging>jar</packaging>
<version>1.1-SNAPSHOT</version>
<name>git-demo</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<scm>
<connection>scm:git:git@github.com:Christian-Achilli-KP/git-demo.git</connection>
<url>scm:git:git@github.com:Christian-Achilli-KP/git-demo.git</url>
<developerConnection>scm:git:git@github.com:Christian-Achilli-KP/git-demo.git</developerConnection>
</scm>
<distributionManagement>
<!-- use the following if you're not using a snapshot version. -->
<repository>
<id>localSnap</id>
<name>RepositoryProxyRel</name>
<url>http://127.0.0.1:8080/nexus/content/repositories/releases/</url>
</repository>
<!-- use the following if you ARE using a snapshot version. -->
<snapshotRepository>
<id>MylocalSnap</id>
<name>RepositoryProxySnap</name>
<url>http://127.0.0.1:8080/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</build>
</project>
실제로 나는 볼 수 있습니다
저장소
내부 선언
distributionManagent
꼬리표.
여기 내 settings.xml
:
<settings>
<servers>
<server>
<id>localSnap</id>
<username>deployment</username>
<password>****</password>
</server>
<server>
<id>MylocalSnap</id>
<username>deployment</username>
<password>****</password>
</server>
<server>
<id>myserver</id>
<username>tomcat</username>
<password>tomcat</password>
</server>
</servers>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://127.0.0.1:8080/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<properties>
<project.build.sourceEncoding>MacRoman</project.build.sourceEncoding>
<project.reporting.outputEncoding>MacRoman</project.reporting.outputEncoding>
</properties>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
왜 불평 하는가?
pom.xml
내부의 파일을 검토하십시오 target/checkout/
. pom.xml
트렁크 또는 마스터 브랜치에 distributionManagement
태그 가 없을 가능성이 있습니다.
동일한 메시지를 받았습니다 ( "repository 요소가 distributionManagement 요소 내부의 POM에 지정되지 않았습니다"). 나는 /target/checkout/pom.xml을 확인하고 다른 답변에 따라 실제로 부족했습니다 <distributionManagement>
.
It turned out that the problem was that <distributionManagement>
was missing in pom.xml in my master branch (using git).
After cleaning up (mvn release:rollback
, mvn clean
, mvn release:clean
, git tag -d v1.0.0
) I run mvn release
again and it worked.
You can also override the deployment repository on the command line: -Darguments=-DaltDeploymentRepository=myreposid::default::http://my/url/releases
The ID of the two repos are both localSnap
; that's probably not what you want and it might confuse Maven.
If that's not it: There might be more repository
elements in your POM. Search the output of mvn help:effective-pom
for repository
to make sure the number and place of them is what you expect.
For me, this was something as simple as a missing version for my artifact - "1.1-SNAPSHOT"
'programing tip' 카테고리의 다른 글
Dockerfile에서 VOLUME의 목적은 무엇입니까 (0) | 2020.10.25 |
---|---|
Vim : 자동 완성을 더 스마트하게 만들기 (0) | 2020.10.25 |
Google API 인텔 x86 아톰과 Google Play 인텔 x86 아톰 시스템 이미지의 차이점 (0) | 2020.10.25 |
C # 컴파일러가 다른 기본 클래스에서 파생 될 때 "유형이 통합 될 수있다"고 불평하는 이유는 무엇입니까? (0) | 2020.10.25 |
Linux oom-killer 로그 이해 (0) | 2020.10.25 |