Maven Require Release Dependencies

项目上线之前必须排除所有SNAP-SHOT版本的依赖 并全部升级为RELEASE版本,手工一个一个去排效率太低,Maven提供了maven-enforcer-plugin插件来做这件事情。

Require Release Dependencies

This rule checks the dependencies and fails if any snapshots are found.

The following parameters are supported by this rule:

  • searchTransitive - if transitive dependencies should be checked.
    Default: true
  • message - an optional message to the user if the rule fails.
  • onlyWhenRelease - if this rule should only be executed when the
    version is a non-SNAPSHOT version. Default: false
  • failWhenParentIsSnapshot - if the parent should be checked. Default:
    true
  • includes - List of dependency patterns to include when checking for
    snapshot versions
  • excludes - List of dependency patterns to exclude when checking for
    snapshot versions
1.Sample Plugin Configuration:
<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce-no-snapshots</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireReleaseDeps>
                  <message>No Snapshots Allowed!</message>
                </requireReleaseDeps>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>


2.Includes/Excludes Plugin Configuration:
<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce-no-snapshots</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireReleaseDeps>
                  <message>No Snapshots Allowed!</message>
                  <excludes>
                    <exclude>org.apache.maven:maven-core</exclude>
                    <exclude>org.apache.maven.plugins:*</exclude>
                  </excludes>
                </requireReleaseDeps>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>

参考

Require Release Dependencies:http://maven.apache.org/enforcer/enforcer-rules/requireReleaseDeps.html

spring-framework-3.0.5.RELEASE-dependencies 好不容易找到了,赶紧分享一下 因为不能大于20M,共分了8个包,都是独立的,我列了目录, 可以只下载需要的包,这是3号包: 1号包: edu.emory.mathcs.backport edu.oswego.cs.concurrent com.bea.commonj com.caucho com.google.jarjar com.h2database com.ibm.websphere com.jamonapi com.lowagie.text com.mchange.c3p0 com.opensymphony.quartz com.oracle.toplink.essentials com.springsource.bundlor com.springsource.util com.sun.syndication com.thoughtworks.xstream 2号包: net.sourceforge.serp net.sourceforge.xslthl org.antlr org.aopalliance javax.activation javax.annotation javax.ejb javax.el javax.faces javax.inject javax.jdo javax.jms javax.mail javax.persistence javax.portlet javax.resource javax.servlet javax.transaction javax.validation javax.xml.bind javax.xml.rpc javax.xml.soap javax.xml.stream javax.xml.ws net.sourceforge.cglib net.sourceforge.ehcache net.sourceforge.jasperreports net.sourceforge.jexcelapi net.sourceforge.jibx 3号包: org.apache.log4j org.apache.openjpa org.apache.axis org.apache.catalina org.apache.commons org.apache.coyote org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache.struts org.apache.taglibs 5号包: org.codehaus.castor org.aspectj org.beanshell 6号包: org.jdom org.jgroups org.codehaus.groovy org.codehaus.jackson org.dom4j org.freemarker org.hibernate org.hsqldb org.jboss.javassist org.jboss.util 7号包: org.eclipse.persistence org.eclipse.jdt 8号包: org.osgi org.slf4j org.springframework org.springframework.build org.testng org.xmlpull org.joda org.jruby org.junit org.objectweb.asm
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值