2013-10-01 15 views
0

我用以下上傳工件到關係存儲庫(與其他參數。避免目標和添加免責聲明文件,同時部署源包,以NEXUS

mvn clean release:perform 

問題我面對的是,源構件包含目標目錄。我還要添加免責聲明文件,這是已經得到綁定許可證和NOTICE文件一起。

有沒有辦法避免的目標,並使用釋放插件參數或pom.xml的配置包括免責條款?

感謝。

+0

如果您的版本包含目標文件夾,則出現問題。 – khmarbaise

+0

你的意思是它的構建方式有問題嗎?或發佈插件配置? –

+0

你能顯示適當的pom文件嗎? – khmarbaise

回答

0

以下maven源插件做了伎倆。它需要額外的「org.apache:apache-incubator-disclaimer-resource-bundle:1.1」resourceBundle來添加DISCLAIMER文件。

  <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-remote-resources-plugin</artifactId> 
       <executions> 
        <execution> 
        <goals> 
          <goal>process</goal> 
        </goals> 
        <configuration> 
          <resourceBundles> 
            <resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle> 
            <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle> 
          </resourceBundles> 
        </configuration> 
        </execution> 
       </executions> 
      </plugin> 

下面的maven-source-plugin配置能夠打包沒有目標的源jar。

  <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-source-plugin</artifactId> 
       <executions> 
        <execution> 
         <id>attach-sources</id> 
         <phase>verify</phase> 
         <goals> 
          <goal>jar-no-fork</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin>