2016-01-13 83 views
2

我在發佈工件到gradle項目中的github時遇到了一些麻煩。我已經創建了一個github存儲庫。我在maven中使用maven-deploy-plugin完成了這個工作,而且它完全直截了當。這是插頭配置。Gradle - 將工件發佈到github

<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中做到這一點?

回答

相關問題