使用maven将上传jar失败到github [英] Fail upload jar into github with maven

查看:173
本文介绍了使用maven将上传jar失败到github的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试遵循:在github上托管Maven存储库



我的POM.xml

 < parent> 
< artifactId> rf< / artifactId>
< groupId> com.zlhades< / groupId>
< version> 1.0-SNAPSHOT< / version>
< / parent>
< modelVersion> 4.0.0< / modelVersion>
< artifactId> rfcore< / artifactId>
<属性>
< java-version> 1.7< / java-version>
< github.global.server> github< /github.global.server>
< / properties>

< build>
< plugins>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 2.3.2< / version>
<配置>
< source> $ {java-version}< / source>
< target> $ {java-version}< / target>
<编码> UTF-8< /编码>
< / configuration>
< / plugin>
< plugin>
< groupId> com.github.github< / groupId>
< artifactId> site-maven-plugin< / artifactId>
< version> 0.12< / version>
<配置>
< message> $ {project.version}的Maven工件< / message> <! - git commit message - >
< noJekyll> true< / noJekyll> <! - 禁用网页处理 - >
< outputDirectory> $ {project.build.directory} / mvn-repo< / outputDirectory> <! - 与上述配送管理储存库网址匹配 - >
< branch> refs / heads / mvn-repo< / branch> <! - 远程分支名称 - >
< includes>< include> ** / *< / include>< / includes>
< repositoryName> RequestForward< / repositoryName> <! - github回购名称 - >
< repositoryOwner> zlhades< / repositoryOwner> <! - github用户名 - >
< / configuration>
<执行次数>
<! - 运行site-maven-plugin的'站点'目标作为构建的正常'部署'阶段的一部分 - >
<执行>
<目标>
< goal>网站< / goal>
< /目标>
<阶段>部署< /阶段>
< /执行>
< /执行次数>
< / plugin>


< / plugins>
< / build>

< distributionManagement>
< repository>
< id> internal.repo< / id>
<名称>临时分段存储库< /名称>
< url> file:// $ {project.build.directory} / mvn-repo< / url>
< / repository>
< / distributionManagement>


<依赖关系>
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> servlet-api< / artifactId>
< version> 2.5< / version>
< scope>编译< / scope>
< /依赖关系>
< dependency>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 4.5< / version>
< scope> test< / scope>
< /依赖关系>
< dependency>
< groupId> org.mockito< / groupId>
< artifactId> mockito-all< / artifactId>
< version> 2.0.2-beta< / version>
< scope> test< / scope>
< /依赖关系>
< /依赖关系>






========================= log == ========================



[错误]未能执行目标
com.github.github:site-maven-plugin:0.12:项目
上的网站(默认)rfcore:创建提交错误:无效请求。



]对于'properties / name',nil不是一个字符串。

[错误]对于'properties / name',nil不是一个字符串。 (422)

[错误] - > [Help 1]


org.apache.maven.lifecycle。 LifecycleExecutionException:无法向
执行目标com.github.github:site-maven-plugin:0.12:站点(默认)$ b $对项目rfcore:创建提交错误:无效请求。



对于'properties / name',nil不是字符串。



对于'properties / name',nil不是字符串。 (422)
========================= log ================= =========


如何解决这个问题?

解决方案

Thx,我找到了答案:
这篇文章底部的评论建议您需要填写github配置文件中的Real Name字段以避免这个错误。

https://malalanayake.wordpress.com/2014/03/10/create-simple-maven-repository-on-github/


I try to follow : Hosting a Maven repository on github

My POM.xml

<parent>
    <artifactId>rf</artifactId>
    <groupId>com.zlhades</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>rfcore</artifactId>
<properties>
    <java-version>1.7</java-version>
    <github.global.server>github</github.global.server>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>${java-version}</source>
                <target>${java-version}</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.github.github</groupId>
            <artifactId>site-maven-plugin</artifactId>
            <version>0.12</version>
            <configuration>
                <message>Maven artifacts for ${project.version}</message>  <!-- git commit message -->
                <noJekyll>true</noJekyll>                                  <!-- disable webpage processing -->
                <outputDirectory>${project.build.directory}/mvn-repo</outputDirectory> <!-- matches distribution management repository url above -->
                <branch>refs/heads/mvn-repo</branch>                       <!-- remote branch name -->
                <includes><include>**/*</include></includes>
                <repositoryName>RequestForward</repositoryName>      <!-- github repo name -->
                <repositoryOwner>zlhades</repositoryOwner>    <!-- github username  -->
            </configuration>
            <executions>
                <!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->
                <execution>
                    <goals>
                        <goal>site</goal>
                    </goals>
                    <phase>deploy</phase>
                </execution>
            </executions>
        </plugin>


    </plugins>
</build>

<distributionManagement>
    <repository>
        <id>internal.repo</id>
        <name>Temporary Staging Repository</name>
        <url>file://${project.build.directory}/mvn-repo</url>
    </repository>
</distributionManagement>


<dependencies>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>2.0.2-beta</version>
        <scope>test</scope>
    </dependency>
</dependencies>

And I got below error:

=========================log==========================

[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.12:site (default) on project rfcore: Error creating commit: Invalid request.

[ERROR] For 'properties/name', nil is not a string.

[ERROR] For 'properties/name', nil is not a string. (422)

[ERROR] -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.github:site-maven-plugin:0.12:site (default) on project rfcore: Error creating commit: Invalid request.

For 'properties/name', nil is not a string.

For 'properties/name', nil is not a string. (422) =========================log==========================

How to fix this issue?

解决方案

Thx, I found the answer: The comment at the bottom of this post suggests that you need to have filled in the Real Name field in your github profile to avoid this error.

https://malalanayake.wordpress.com/2014/03/10/create-simple-maven-repository-on-github/

这篇关于使用maven将上传jar失败到github的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆