English 中文(简体)
Why does Maven2 check for updates of stax-ex at every build?
原标题:

Maven2 checks for updates of stax-ex at every build. And it s just checking this single dependency, all other dependencies are updated only once per day.

Maven2 output:

artifact org.jvnet.staxex:stax-ex: checking for updates from java.net

stax-ex (groupid: org.jvnet.staxex, version: 1.2) is included as part of jaxws-rt (groupid: com.sun.xml.ws, version: 2.1.3). We have an artifactory repository as intermediary.

What could I do? ( Building offline would be an unpopular work-around.)

最佳回答

It looks like you have remote repository declarations in your POMs that bypass your enterprise repository. If you are using Artifactory you can either have remote repository references in POMs automatically stripped off on a virtual repository level, or configure mirror-any in your settings to enforce artifact resolution go strictly through your Artifactory.

问题回答

I had the same problem, and wanted to get to the bottom of it!

The problem is in the pom.xml file of streambuffer (a dependency of jaxws-rt), which doesn t specify a version for stax-ex. Instead, it uses RELEASE, meaning the latest released version:

<dependency>
  <groupId>org.jvnet.staxex</groupId>
  <artifactId>stax-ex</artifactId>
  <version>RELEASE</version>
</dependency>

This forces Maven to check constantly for the latest release of stax-ex (even if jaxws-rt itself requests version 1.2), by downloading its corresponding maven-metadata.xml.

An easy workaround is to force the version of stax-ex in a dependencyManagement section of your pom.xm:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.jvnet.staxex</groupId>
      <artifactId>stax-ex</artifactId>
      <version>1.2</version>
    </dependency>
  </dependencies>
</dependencyManagement>

And then Maven will stop bothering you about this warning...





相关问题
Derby gets stuck closing?

I ve got unit tests (in maven) that use derby. At the end of the test run, there is a very long pause, with these log messages before the pause. INFO: Closing Hibernate SessionFactory Nov 16, 2009 8:...

Execute goal on parent after children complete

I have a multi-module maven project (several levels of nesting). Normally, when I execute a maven build (like mvn install or whatever), maven will run all the goals for the parent project before ...

Including dependencies in a jar with Maven

Is there a way to force maven(2.0.9) to include all the dependencies in a single jar file? I have a project the builds into a single jar file. I want the classes from dependencies to be copied into ...

Java Equivalent of distcc

Distcc makes it easy to distribute a C or C++ compile job across a number of machines, and is a godsend for working with large, frequently-built codebases. An increasing number of our large projects ...

Maven Assembly Problem

I have a maven multiple-module project, which is giving me headaches in the assembly:assembly phase. I have a module which has an assembly defined in it which works fine when I invoke mvn assembly:...

热门标签