Hi Martin,

Martin Höller wrote:
On Thursday 11 September 2008 Wendy Smoak wrote:
On Thu, Sep 11, 2008 at 5:03 AM, Martin Höller <[EMAIL PROTECTED]> wrote:
Unfortunately this dependency's pom.xml specifies other remote
repositories. Could someone please tell me what is the recomended way
to avoid getting a new repository into my environment?
You can use mirrors, especially mirrorOf=*, to prevent additional
repositories from being introduced.

http://maven.apache.org/guides/mini/guide-mirror-settings.html

That doesn't prevent additional repositories of beeing introduced. It just prevents direct usage of them, which is IMHO just a workaround but no solution.

I am not sure what you try to do? You want to add a new jar file, but you do not want to introduce a dependency to the repository where that jar file lives, right?

Let's introduce some names:
- your pom : project.pom.xml
- the dependency that you introduced by hand : A.pom.original.xml
- a sub dependency that A.pom.original.xml mentions : B.pom.xml

That jar file has in its A.pom.original.xml other dependencies that live in other remote repositories that you do not want to introduce in your project.pom.xml of your project. For sure the jar that you included needs these additional dependencies, because otherwise it would not mention them in its A.pom.original.xml in the first place.

If you fulfilled those dependencies on the several B.pom.xml already by some other way, e.g. you introduced them in your local repository by hand and introduced those dependencies into your project.pom.xml via a separate <dependency/>, then you can use <exclude/> on the original dependency that you have in project.pom.xml like that:
                        <dependency>
                                <groupId>...</groupId>
                                <artifactId>A</artifactId>
                                <version>...</version>
                                <exclusions>
                                        <exclusion>
                                                <groupId>...</groupId>
                                                <artifactId>B</artifactId>
                                        </exclusion>
...
                                </exclusions>
                        </dependency>

In this case maven will not try to resolve the dependencies you have in the A.pom.original.xml

Another even simpler way is to create a A.pom.modified.xml yourself for your jar that you introduced in your local repository :) Why do you want to use the A.pom.original.xml that you downloaded manually from the remote repository if that pom.xml causes you problems?

I hop that helps,
--
Christian Schuhegger
http://www.el-chef.de/

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

Reply via email to