为了nutzwk插件使用方便,想着把它上传到maven公共仓库。没想到折腾起来辣么费劲。
目前已经将项目上传到snapshots仓库:https://oss.sonatype.org/content/repositories/snapshots
接着上传到releases仓库的时候出现问题了。
下面是我的pom.xml内容
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.enilu.tools</groupId>
<artifactId>nutzwk-code-generator</artifactId>
<packaging>jar</packaging>
<name>nutzwk-code-generator</name>
<version>1.0-SNAPSHOT</version>
<properties>
<java-version>1.7</java-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<nutz-version>1.r.56.r3</nutz-version>
<javax.validation-version>1.1.0.Final</javax.validation-version>
<evo-inflector-version>1.0.1</evo-inflector-version>
<guava-version>18.0</guava-version>
<velocity-version>1.7</velocity-version>
<druid-version>1.0.20</druid-version>
<mysql-driver-version>5.1.39</mysql-driver-version>
<commons-cli-version>1.2</commons-cli-version>
</properties>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<id>enilu</id>
<name>enilu</name>
<email>eniluzt@qq.com</email>
<url>http://www.enilu.cn</url>
</developer>
</developers>
<scm>
<connection>scm:git:git@github.com:enilu/nutzwk-code-generator.git</connection>
<developerConnection>scm:git:git@github.com:enilu/nutzwk-code-generator.git</developerConnection>
<url>git@github.com:enilu/nutzwk-code-generator.git</url>
<tag>nutzwk-code-generator-1.0</tag>
</scm>
<dependencies>
<!--代码生成单独需要的依赖-->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${javax.validation-version}</version>
</dependency>
<dependency>
<groupId>org.atteo</groupId>
<artifactId>evo-inflector</artifactId>
<version>${evo-inflector-version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava-version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>${commons-cli-version}</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>${velocity-version}</version>
</dependency>
<!--nutzwx 中具备的依赖-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid-version}</version>
<exclusions>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>jconsole</artifactId>
</exclusion>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>tools</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-driver-version}</version>
</dependency>
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz</artifactId>
<version>${nutz-version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<preparationGoals>clean install</preparationGoals>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Sonatype Nexus snapshot repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>nexus-releases</id>
<name>Sonatype Nexus release repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
</project>
我使用mvn clean deploy 上传snapshots仓库,接下来使用命令mvn release:clean release:prepare release:perform 往releases仓库上传的时候报错了。报错内容为(为了方便代码全部粘贴出来,报错内容在最后面):
[root@zhangtao nutzwk-code-generator]# mvn release:clean release:prepare release:perform
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building nutzwk-code-generator 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.5.3:clean (default-cli) @ nutzwk-code-generator ---
[INFO] Cleaning up after release...
[INFO]
[INFO] --- maven-release-plugin:2.5.3:prepare (default-cli) @ nutzwk-code-generator ---
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: **/pom.xml.backup, **/release.properties, **/pom.xml.branch, **/pom.xml.next, **/pom.xml.releaseBackup, **/pom.xml.tag
[INFO] Executing: /bin/sh -c cd /home/public/workspace/git/nutzws/nutzwk-code-generator && git rev-parse --show-toplevel
[INFO] Working directory: /home/public/workspace/git/nutzws/nutzwk-code-generator
[INFO] Executing: /bin/sh -c cd /home/public/workspace/git/nutzws/nutzwk-code-generator && git status --porcelain .
[INFO] Working directory: /home/public/workspace/git/nutzws/nutzwk-code-generator
[INFO] Checking dependencies and plugins for snapshots ...
What is the release version for "nutzwk-code-generator"? (cn.enilu.tools:nutzwk-code-generator) 1.0: :
What is SCM release tag or label for "nutzwk-code-generator"? (cn.enilu.tools:nutzwk-code-generator) nutzwk-code-generator-1.0: :
What is the new development version for "nutzwk-code-generator"? (cn.enilu.tools:nutzwk-code-generator) 1.1-SNAPSHOT: :
[INFO] Transforming 'nutzwk-code-generator'...
[INFO] Not generating release POMs
[INFO] Executing goals 'clean install'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building nutzwk-code-generator 1.0
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO]
[INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ nutzwk-code-generator ---
[INFO] [INFO] Deleting /home/public/workspace/git/nutzws/nutzwk-code-generator/target
[INFO] [INFO]
[INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ nutzwk-code-generator ---
[INFO] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] [INFO] Copying 8 resources
[INFO] [INFO]
[INFO] [INFO] --- maven-compiler-plugin:3.5:compile (default-compile) @ nutzwk-code-generator ---
[INFO] [INFO] Changes detected - recompiling the module!
[INFO] [INFO] Compiling 6 source files to /home/public/workspace/git/nutzws/nutzwk-code-generator/target/classes
[INFO] [INFO] /home/public/workspace/git/nutzws/nutzwk-code-generator/src/main/java/cn/enilu/common/code/TableDescLoader.java: /home/public/workspace/git/nutzws/nutzwk-code-generator/src/main/java/cn/enilu/common/code/TableDescLoader.java使用了未经检查或不安全的操作。
[INFO] [INFO] /home/public/workspace/git/nutzws/nutzwk-code-generator/src/main/java/cn/enilu/common/code/TableDescLoader.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO] [INFO]
[INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ nutzwk-code-generator ---
[INFO] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] [INFO] skip non existing resourceDirectory /home/public/workspace/git/nutzws/nutzwk-code-generator/src/test/resources
[INFO] [INFO]
[INFO] [INFO] --- maven-compiler-plugin:3.5:testCompile (default-testCompile) @ nutzwk-code-generator ---
[INFO] [INFO] No sources to compile
[INFO] [INFO]
[INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ nutzwk-code-generator ---
[INFO] [INFO] No tests to run.
[INFO] [INFO]
[INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ nutzwk-code-generator ---
[INFO] [INFO] Building jar: /home/public/workspace/git/nutzws/nutzwk-code-generator/target/nutzwk-code-generator-1.0.jar
[INFO] [INFO]
[INFO] [INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ nutzwk-code-generator ---
您需要输入密码,才能解开这个用户的私钥:“enilu <eniluzt@qq.com>”
2048 位的 RSA 密钥,钥匙号 E7019D3A,建立于 2016-07-26
[INFO] can't connect to `/root/.gnupg/S.gpg-agent': 没有那个文件或目录
[INFO]
[INFO] (pinentry-gtk-2:10145): GLib-GObject-CRITICAL **: Object class GtkSecureEntry doesn't implement property 'editing-canceled' from interface 'GtkCellEditable'
您需要输入密码,才能解开这个用户的私钥:“enilu <eniluzt@qq.com>”
2048 位的 RSA 密钥,钥匙号 E7019D3A,建立于 2016-07-26
[INFO] can't connect to `/root/.gnupg/S.gpg-agent': 没有那个文件或目录
[INFO]
[INFO] (pinentry-gtk-2:10153): GLib-GObject-CRITICAL **: Object class GtkSecureEntry doesn't implement property 'editing-canceled' from interface 'GtkCellEditable'
[INFO] [INFO]
[INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ nutzwk-code-generator ---
[INFO] [INFO] Installing /home/public/workspace/git/nutzws/nutzwk-code-generator/target/nutzwk-code-generator-1.0.jar to /home/public/repository/cn/enilu/tools/nutzwk-code-generator/1.0/nutzwk-code-generator-1.0.jar
[INFO] [INFO] Installing /home/public/workspace/git/nutzws/nutzwk-code-generator/pom.xml to /home/public/repository/cn/enilu/tools/nutzwk-code-generator/1.0/nutzwk-code-generator-1.0.pom
[INFO] [INFO] Installing /home/public/workspace/git/nutzws/nutzwk-code-generator/target/nutzwk-code-generator-1.0.jar.asc to /home/public/repository/cn/enilu/tools/nutzwk-code-generator/1.0/nutzwk-code-generator-1.0.jar.asc
[INFO] [INFO] Installing /home/public/workspace/git/nutzws/nutzwk-code-generator/target/nutzwk-code-generator-1.0.pom.asc to /home/public/repository/cn/enilu/tools/nutzwk-code-generator/1.0/nutzwk-code-generator-1.0.pom.asc
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 12.567 s
[INFO] [INFO] Finished at: 2016-07-26T23:48:28+08:00
[INFO] [INFO] Final Memory: 17M/205M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd /home/public/workspace/git/nutzws/nutzwk-code-generator && git add -- pom.xml
[INFO] Working directory: /home/public/workspace/git/nutzws/nutzwk-code-generator
[INFO] Executing: /bin/sh -c cd /home/public/workspace/git/nutzws/nutzwk-code-generator && git rev-parse --show-toplevel
[INFO] Working directory: /home/public/workspace/git/nutzws/nutzwk-code-generator
[INFO] Executing: /bin/sh -c cd /home/public/workspace/git/nutzws/nutzwk-code-generator && git status --porcelain .
[INFO] Working directory: /home/public/workspace/git/nutzws/nutzwk-code-generator
[INFO] Executing: /bin/sh -c cd /home/public/workspace/git/nutzws/nutzwk-code-generator && git commit --verbose -F /tmp/maven-scm-1740693310.commit pom.xml
[INFO] Working directory: /home/public/workspace/git/nutzws/nutzwk-code-generator
[INFO] Executing: /bin/sh -c cd /home/public/workspace/git/nutzws/nutzwk-code-generator && git symbolic-ref HEAD
[INFO] Working directory: /home/public/workspace/git/nutzws/nutzwk-code-generator
[INFO] Executing: /bin/sh -c cd /home/public/workspace/git/nutzws/nutzwk-code-generator && git push git@github.com:enilu/nutzwk-code-generator.git refs/heads/master:refs/heads/master
[INFO] Working directory: /home/public/workspace/git/nutzws/nutzwk-code-generator
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.174 s
[INFO] Finished at: 2016-07-26T23:48:33+08:00
[INFO] Final Memory: 12M/205M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project nutzwk-code-generator: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] Permission denied (publickey).
[ERROR] fatal: Could not read from remote repository.
[ERROR]
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
貌似github相关配置不正确?但是应该怎么配置呢