Roye, Suhneel BGI SF wrote on Wednesday, April 19, 2006 12:06 PM:

> Problem:
> I have a custom JAR (built by our team) installed in my local
> repository, and yet every time I do a build, Maven attempts
> to download
> it from Central (iBiblio) before realizing it's located in my local
> repository. I would like to prevent Maven from attempting to download
> this JAR from Central every time I do a build.
> 
> Existing Solution:
> Has anyone successfully dealt with this problem? I've seen several
> threads on this topic without any resolution. I do not want
> to override
> Central or disable downloading of JAR's from Central.
> 
> Potential Solution:
> I would like to be able to specify the order in which Maven looks up
> repositories. I would like for it to first look in my local
> repository, then at a shared (corporate) repository, and finally go
> out to the Central (iBiblio) repository. 

This will not really help, for SNAPSHOTs Maven has to look in every repository. 
A solution would be a configuration section for repository definitions with 
includes and excludes to match groupIds e.g.:

...
<repository>
        <!-- merge with central definition, exclude stuff from own company or 
other commercial vendors -->
        <id>central</id>
        <configuration>
                <excludes>
                        <exclude>com.mycompany.*</exclude>
                        <exclude>com.commercial.vendor.*</exclude>
                </excludes>
        </configuration>
</repository>
<repository>
        <!-- repo for stuff from commercial vendors -->
        <id>local-repo</id>
        ...
        <configuration>
                <includes>
                        <include>com.commercial.vendor.*</include>
                </includes>
        </configuration>
</repository>
<repository>
        <!-- repo for stuff from own company -->
        <id>products</id>
        ...
        <configuration>
                <includes>
                        <include>com.mycompany.*</include>
                </includes>
        </configuration>
</repository>
...


- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to