Hey,

I am working with a large project's dependencies, which is in it's
development phase. So all it's modules have -SNAPSHOT versions. This means
every day my first build for every project wants to do some SNAPSHOT checks.
Doing a complete build (which I usually do after a subversion update) wastes
a lot of time in SNAPSHOT downloading.

Some dependencies give 404 not found errors and would then waste time with
EVERY build.

So I disabled snapshots adding this and activating profile
"disable-snapshots":
    <profile>
      <id>disable-snapshots</id>

      <repositories>
        <repository>
          <id>java.net</id>
          <url>http://download.java.net/maven/1</url>
          <snapshots><enabled>false</enabled></snapshots>
        </repository>
       <!-- all my repositories-->
      </repositories>
   </profile>

In the mean while I have started using Nexus. This makes many things easier
and saves a lot of bandwidth. Though now I can't disable snapshots. Nexus
caches the results, so when a snapshot download fails and it retries it with
every build the checks are almost instantaneous. Though the first build
every day still takes time as it does the initial update requests.

My nexus is configured in maven as so:
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:7081/nexus/content/groups/public</url>
    </mirror>
    <profile>
      <id>nexus</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>

Then I activate profile "nexus". I have tried changing the above <snapshots>
to false, and I've tried setting things like these in "disable-snapshots'
profile and activating both, in either order:
        <repository>
          <id>central</id>
          <url>http://central</url>
          <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <repository>
          <id>nexus</id>
          <url>http://localhost:7081/nexus/content/groups/public</url>
          <snapshots><enabled>false</enabled></snapshots>
        </repository>

None of these seem to have an effect. How can I selectively disable snapshot
update checks when using nexus?

Quintin Beukes

Reply via email to