Gradle - 将工件发布到github

时间:2016-01-13 08:07:56

标签: java gradle

我在gradle项目中将工件发布到github时遇到了一些麻烦。我已经创建了一个github存储库。我使用maven-deploy-plugin在maven中做到了这一点并且完全直截了当。这是插入式配置。

<plugins>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.1</version>
                <configuration>
                    <altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.github</groupId>
                <artifactId>site-maven-plugin</artifactId>
                <version>0.11</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/master</branch>                       <!-- remote branch name -->
                    <includes><include>**/*</include></includes>
                    <repositoryName>{git_repo_name}</repositoryName>      <!-- github repo name -->
                    <repositoryOwner>{git_user_name}</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>

但我的问题是如何在gradle中做到这一点?

1 个答案:

答案 0 :(得分:1)

gradle的美丽和诅咒是灵活性。谷歌搜索显示3个有前途的插件:

也许其中一个解决了你的问题。如果您正在寻找特定的东西,请告诉我。