I have been looking into this for a couple of days and can't find the
answer. I suspect it isn't possible but I think it will be best to ask
those who can tell me definitively.

I want to be able to define a project which only has access to an
internally defined repository. Note I said project not user.  Using the
settings.xml to define my interal repository as the mirror to external
ones I don't think is the right thing to do.  Doing this makes the
project unportable since all developers on the project would have to
share the same settings.xml file.  Bad mojo.

I have tried modifying my POM file such that it overrides the central
repo... like this:

  <repositories>
    <repository>
      <id>central</id>
      <url>http://myinteralrepo</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <url>http://myinteralrepo</url>
    </pluginRepository>
  </pluginRepositories>

However, this does not seem to be sufficient.  Most dependencies are
coming from my local repo but not all and I can't figure out why some
are not.  Here is a snippet of maven output.

url = http://myinteralrepo
Downloading:
http://myinteralrepo/org/apache/maven/plugins/maven-resources-plugin/2.2
/maven-resources-plugin-2.2.pom
url = http://repo1.maven.org/maven2
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/1/m
aven-plugins-1.pom
3K downloaded
url = http://repo1.maven.org/maven2
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-parent/1/maven-pare
nt-1.pom
6K downloaded

What is special about the first artifact, maven-resources-pluggin-2.2,
such that it comes from my internal repo but the others come from maven
central?

The only way that I have been completely successful in ensuring that all
artifacts come from my internal repo is by making the appropriate
changes to my settings.xml file.  But as I have already mentioned, I
don't wish to do this.

Thoughts?


---
Todd Thiessen

Reply via email to