2012-05-09 44 views

回答

6
<profile> 
    <id>jenkins</id> 
    <!-- This profile is activated by the "-P jenkins" switch when run on 
     the build server by Jenkins (continuous integration) --> 
    <build> 
     <plugins> 
      <!-- Jenkins should only build -SNAPSHOTs --> 
      <plugin> 
       <artifactId>maven-enforcer-plugin</artifactId> 
       <executions> 
        <execution> 
         <goals> 
          <goal>enforce</goal> 
         </goals> 
         <configuration> 
          <rules> 
           <evaluateBeanshell> 
           <condition>"${project.version}".endsWith("-SNAPSHOT")</condition> 
           <message>Jenkins should only build -SNAPSHOT versions</message> 
           </evaluateBeanshell> 
          </rules> 
          <fail>true</fail> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 
</profile> 
+0

很多人都在網上抱怨使用Maven插件版本部署失敗(可怕的400錯誤等)。我敢打賭,他們的Jenkins實例多次被配置爲部署,然後才能在控制檯中執行操作。兩個部署等於失敗。這確實解決了問題。謝謝!!! – ingyhere