目录
maven 项目对于我们开发大大减少了我们的开始时间,提高了开发效率,那么如何开发出属于自己的一套maven项目了。今天来看看如何上传maven项目到中央仓库
com.github.zxhtom
,那么sonatype会要求你拥有github.com的所有权。因为github是开放性网站。另外zxhtom是我再github上的注册名。所有github.com/zxhtom这个地址就是属于我,所哟这样写就会验证通过。如果你有自己的域名zxhtom.com 。那么你的groupid就是是com.zxhtom.***
这些配置好会出现下面的画面说明配置成功
最后我们通过下面的命令将公钥提交到服务器 (97f3f174是pub id ,pgp不同版本pub id 长度不一样。我们不用在意)
gpg2 --keyserver hkp://pool.sks-keyservers.net --send-keys 97f3f174
<build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-source-plugin</artifactid> <version>2.1.2</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar-no-fork</goal> </goals> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-javadoc-plugin</artifactid> <version>2.7</version> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-gpg-plugin</artifactid> <version>1.1</version> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <licenses> <license> <name>the apache license, version 2.0</name> <url>http://www.apache.org/licenses/license-2.0.txt</url> </license> </licenses> <developers> <developer> <name>zxhtom</name> <email>870775401@qq.com</email> <roles> <role>developer</role> </roles> <timezone>+8</timezone> </developer> </developers> <scm> <connection>scm:git:https://github.com/zxhtom/bottom.git</connection> <developerconnection>scm:git:https://github.com/zxhtom/bottom.git</developerconnection> <url>https://github.com/zxhtom/bottom</url> <tag>${project.version}</tag> </scm> <distributionmanagement> <snapshotrepository> <id>ossrh</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> </snapshotrepository> <repository> <id>ossrh</id> <name>maven central staging repository</name> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> </repository> </distributionmanagement>
<!-- 前两个如果我们用的是继承oss-parent需要的。 --> <server> <id>sonatype-nexus-snapshots</id> <username>zxhtom</username> <password>*****</password> </server> <server> <id>sonatype-nexus-staging</id> <username>zxhtom</username> <password>******</password> </server> <!-- 下面这个使我们自定义用到的服务 --> <server> <id>ossrh</id> <username>zxhtom</username> <password>*****</password> </server>
``` <profile> <id>ossrh</id> <activation> <activebydefault>true</activebydefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>*****</gpg.passphrase> </properties> </profile> ```
mven clean deploy
效果
进入上方网站登录后进行查看我们是否发布的jar
如对本文有疑问, 点击进行留言回复!!
[杭电多校2020]第一场 1004 Distinct Sub-palindromes
Swift -- 将本地生成的UIImage进行持久化保存(存到文件中fileManager.createFile)
网友评论