maven 打包报错

Require upper bound dependencies error for org.springframework:spring-context-support:3.2.5.RELEASE paths to dependency are:
+-com.baidu.lbc:owl-worker:0.0.1-SNAPSHOT
  +-org.springframework.integration:spring-integration-mail:3.0.1.RELEASE
    +-org.springframework:spring-context-support:3.2.5.RELEASE (managed) <-- org.springframework:spring-context-support:3.2.6.RELEASE
]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] owl ............................................... SUCCESS [6.797s]
[INFO] owl-core .......................................... SUCCESS [2.184s]
[INFO] owl-dal ........................................... SUCCESS [0.990s]
[INFO] owl-service ....................................... SUCCESS [0.736s]
[INFO] owl-worker ........................................ FAILURE [0.210s]
[INFO] owl-admin-web ..................................... SKIPPED
[INFO] owl-client ........................................ SKIPPED
[INFO] owl-remote ........................................ SKIPPED
[INFO] owl-notification .................................. SKIPPED
[INFO] owl-worker-web .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.491s
[INFO] Finished at: Sat Mar 15 13:25:17 CST 2014
[INFO] Final Memory: 23M/1932M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-banned-dependencies) on project owl-worker: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-banned-dependencies) on project owl-worker: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
        at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:209)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
[ERROR]

 

原因:

看错误原因应该是包冲突,后分析是maven依赖包冲突

<dependency>
   <groupId>org.springframework.integration</groupId>
   <artifactId>spring-integration-mail</artifactId>
   <exclusions>
    <exclusion>
       <groupId>org.springframework</groupId>
         <artifactId>spring-context-support</artifactId>
    </exclusion>
    <exclusion>
       <groupId>org.springframework</groupId>
         <artifactId>spring-context</artifactId>
    </exclusion>
    <exclusion>
       <groupId>org.springframework</groupId>
          <artifactId>spring-tx</artifactId>
    </exclusion>
   </exclusions>
  </dependency>

 

加上exclusions排除冲突的包

你可能感兴趣的:(maven)