maven打包上传到本地中央库
Posted 花月世界
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven打包上传到本地中央库相关的知识,希望对你有一定的参考价值。
pom文件中添加插件如下
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${java.version}</source> <target>${java.version}</target> <testSource>${java.version}</testSource> <testTarget>${java.version}</testTarget> </configuration> </plugin> <!--配置生成源码包--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <distributionManagement> <repository> <id>releases</id> <name>Nexus Release Repository</name> <url>http://xxxx:8081/repository/cetccd_hosted/</url> </repository> <snapshotRepository> <id>snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://xxxx:8081/repository/cetccd_snapshots/</url> </snapshotRepository> </distributionManagement>
settings.xml文件添加如下内容
<server> <id>snapshots</id> <username>admin</username> <password>xxxx</password> </server> <server> <id>releases</id> <username>admin</username> <password>xxxx</password> </server>
clean deploy -Dmaven.test.skip=true
以上是关于maven打包上传到本地中央库的主要内容,如果未能解决你的问题,请参考以下文章