我是靠谱客的博主 沉默小霸王,这篇文章主要介绍Maven: repository element was not specified in the POM inside distributionManagement?,现在分享给大家,希望可以做个参考。
我正在尝试运行该命令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
文件:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48<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>
其实我可以看到
repository
里面的声明
distributionManagent
这是我的settings.xml
:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63<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>
最后
以上就是沉默小霸王最近收集整理的关于Maven: repository element was not specified in the POM inside distributionManagement?的全部内容,更多相关Maven:内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复