请务必以github进行登入,这样就可以有免费的namespace可以用
原文
If you do not see this pop-up AND you signed up with GitHub, then Sonatype was able to grant you permissions to the namespace associated with your GitHub identity automatically. As part of your GitHub subscription, GitHub provides you with a github.io domain that reflects your username and allows you to publish GitHub Pages under that domain. Because of this, Sonatype can, in most cases, automatically verify and provision publishing access to a namespace that looks like io.github..
<groupId>io.github.internetms52</groupId> <artifactId>object-pool</artifactId> <version>0.1.3</version> <name>object-pool</name> <packaging>jar</packaging> <url>https://github.com/internetms52/object-pool-maven-lib</url> <description>This is a library that implements an Object Pool, and it supports nested object creation as well as constructor specification.</description>
View Account > Generate User Token
完成后就会取得settings.xml所需的资讯
<settings> <servers> <server> <id>central</id> <username>XXXXXX</username> <password>YYYYYY</password> </server> </servers> </settings>
<plugin> <groupId>org.sonatype.central</groupId> <artifactId>central-publishing-maven-plugin</artifactId> <version>0.5.0</version> <extensions>true</extensions> <configuration> <publishingServerId>central</publishingServerId> </configuration> </plugin>
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>3.2.0</version> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
sudo apt-get install gnupg gpg --full-generate-key gpg --list-keys
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> <configuration> <gpgArguments> <arg>--pinentry-mode</arg> <arg>loopback</arg> </gpgArguments> </configuration> </execution> </executions> </plugin>
GPG的公钥server有两个比较有名的
gpg --keyserver hkp://pgp.mit.edu --send-keys F1BD06AB06C36BD5EB53B6E8710DEC40549547D2 gpg: sending key 710DEC40549547D2 to hkp://pgp.mit.edu gpg --keyserver hkp://keyserver.ubuntu.com --send-keys F1BD06AB06C36BD5EB53B6E8710DEC40549547D2 gpg: sending key 710DEC40549547D2 to hkp://keyserver.ubuntu.com
<developers> <developer> <name>LU.YU HSIN</name> <email>yourmail@mail.com</email> <organization>internetms52</organization> <organizationUrl>https://github.com/internetms52/object-pool-maven-lib</organizationUrl> </developer> </developers>
<scm> <connection>scm:git:git@github.com:internetms52/object-pool-maven-lib.git</connection> <developerConnection>scm:git:git@github.com:internetms52/object-pool-maven-lib.git</developerConnection> <url>https://github.com/internetms52/object-pool-maven-lib</url> </scm>
<licenses> <license> <name>Apache License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> </license> </licenses>
object-pool-maven-lib
以上是Java开源开发者指南:构建并部署到Maven Central的详细内容。更多信息请关注PHP中文网其他相关文章!