You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris Bozic <cb...@gmail.com> on 2005/06/21 16:48:29 UTC

M2 Jar Override

Is there any jar override equivalent in M2?  Basically, I need to
include some jars in my project that don't already exist in a public
m2 repo.  I don't want to set up a web server with a personal remote
repo to accomplish this.  I also don't want to copy the jars into my
local repo manually.  Is there any way that I can check out a project
from source control and have M2 use some jars that are within that
project structure?

Thanks,
Chris Bozic

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: M2 Jar Override

Posted by Brett Porter <br...@gmail.com>.
On 6/22/05, Chris Bozic <cb...@gmail.com> wrote:
> This wouldn't have to cause transitive dependencies to fail.  The
> project's repo could (and probably should) meet the layout of the
> regular local repo.  What I am really looking for is less of a "jar
> override" and more of a way to specify a project's local repo in my
> pom.xml.  Like this:
> 
> ...
> <repositories>
>         <repository>
>                 <id>local</id>
>                 <name>local</name>
>                 <url>/home/cbozic/workspace/myproject/localrepo</url>
>         </repository>
> </repositories>
> ...

Sorry, I misunderstood, as this isn't really like JAR overrides.

You can already do what you are after:
http://maven.apache.org/maven2/maven-model/maven.html#class_Repository

What you probably want to do is make the URL a property specified in
your settings.xml so that other developers can set their own location,
or set it to a default and they can override it from settings.xml.

The URL would be file://localhost/home/... btw.

Cheers,
Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: M2 Jar Override

Posted by Chris Bozic <cb...@gmail.com>.
On 6/21/05, Brett Porter <br...@gmail.com> wrote:
> In short, not really. It is possible to write your own resolver
> (someone on the list has attempted this already), but that is possibly
> more work than you'd like.
> 
> Several features in Maven 2 depend on the existence of a repository,
> hence this requirement. If dependencies were located relative to a
> project, transitive dependencies would fail, for example.

This wouldn't have to cause transitive dependencies to fail.  The
project's repo could (and probably should) meet the layout of the
regular local repo.  What I am really looking for is less of a "jar
override" and more of a way to specify a project's local repo in my
pom.xml.  Like this:

...
<repositories>
	<repository>
		<id>local</id>
		<name>local</name>
		<url>/home/cbozic/workspace/myproject/localrepo</url>
	</repository>
</repositories>
...


> I think the key is that you don't want to copy them into the local
> repository manually: but you'd be happy with automatically? It would
> actually be reasonably simple to write your own plugin that occurs in
> the first phase (validate in alpha-3) and copies those jars into the
> local repository if it doesn't exist. If you'd like to do this and
> need help, just let us know - but the plugin documentation on the web
> site is a good place to start.
> 

Well, writing my own plugin is to do the copy isnt the solution I was
hoping for but is a solution.  :)  Is M2 going to support this before
the final release?  This seems like a requirement because of the
following reasons:

- Although the M2 Repo is more robust than the original Maven repo, it
can't possibly have every dependency that any project is ever going to
need.

- It isn't right to have developers manually copying dependancies to
their local repo upon a fresh checkout because this violates the
"making the build process easy" and "uniform build system" objectives.

- For simple/small projects it isn't right to force a developer to set
up a web server to host their own maven repo because this adds much
overhead to creating projects.

So, I wonder if M2 is going to support some way to solve this problem
before the final release.  If so, what is the approach M2 plans to
take?  I don't mind writing a plugin and possibly contributing to the
project.  If there are no plans to support this feature, could someone
help me understand why?

Thanks,
Chris Bozic

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: M2 Jar Override

Posted by Brett Porter <br...@gmail.com>.
In short, not really. It is possible to write your own resolver
(someone on the list has attempted this already), but that is possibly
more work than you'd like.

Several features in Maven 2 depend on the existence of a repository,
hence this requirement. If dependencies were located relative to a
project, transitive dependencies would fail, for example.

I think the key is that you don't want to copy them into the local
repository manually: but you'd be happy with automatically? It would
actually be reasonably simple to write your own plugin that occurs in
the first phase (validate in alpha-3) and copies those jars into the
local repository if it doesn't exist. If you'd like to do this and
need help, just let us know - but the plugin documentation on the web
site is a good place to start.

Cheers,
Brett

On 6/22/05, Chris Bozic <cb...@gmail.com> wrote:
> Is there any jar override equivalent in M2?  Basically, I need to
> include some jars in my project that don't already exist in a public
> m2 repo.  I don't want to set up a web server with a personal remote
> repo to accomplish this.  I also don't want to copy the jars into my
> local repo manually.  Is there any way that I can check out a project
> from source control and have M2 use some jars that are within that
> project structure?
> 
> Thanks,
> Chris Bozic
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org