brew install gnupg
➜ ~ gpg --version gpg (GnuPG) 1.4.20 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Home: ~/.gnupg 支持的算法: 公鑰:RSA, RSA-E, RSA-S, ELG-E, DSA 對稱加密:IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH, CAMELLIA128, CAMELLIA192, CAMELLIA256 散列:MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224 壓縮:不壓縮, ZIP, ZLIB, BZIP2
gpg --gen-key
gpg --list-keys
gpg --keyserver hkp://pool.sks-keyservers.net --send-keys xxxxxxxx
其中xxxxxxxx爲你的公鑰idhtml
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys xxxxxxxx
~/.m2/settings.xmljava
<settings> <servers> <server> <id>oss</id> <username>用戶名</username> <password>密碼</password> </server> </servers> </settings>
<issueManagement> <system>Github Issue</system> <url>https://github.com/xxx/xxx-xxx/issues</url> </issueManagement> <licenses> <license> <name>The Apache Software License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> </license> </licenses> <developers> <developer> <name>xxx</name> <email>xxx@gmail.com</email> </developer> </developers> <scm> <connection>scm:git@github.com:xxx/xxx-xxx.git</connection> <developerConnection>scm:git@github.com:xxx/xxx-xxx.git</developerConnection> <url>git@github.com:xxx/xxx-xxx.git</url> </scm> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${java.version}</source> <target>${java.version}</target> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.10.4</version> <configuration> <aggregate>true</aggregate> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>release</id> <distributionManagement> <snapshotRepository> <id>oss</id> <url>https://oss.sonatype.org/content/repositories/snapshots/</url> </snapshotRepository> <repository> <id>oss</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> </repository> </distributionManagement> <build> <plugins> <!-- Source --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>jar-no-fork</goal> </goals> </execution> </executions> </plugin> <!-- Javadoc --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.10.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <!-- Gpg Signature --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>1.6</version> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles>
mvn clean deploy -P release -Dgpg.passphrase=xxxx
https://oss.sonatype.org/cont...git
發佈Maven構件到中央倉庫github
想獲取最新內容,請關注微信公衆號spring