maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barrie Treloar <baerr...@gmail.com>
Subject Re: Eclipse Plugin and Project Links to Independent Projects
Date Tue, 05 Jun 2012 00:08:56 GMT
On Tue, Jun 5, 2012 at 3:19 AM, Chris Redekop <chris.redekop@gmail.com> wrote:
> (How) can I use the Eclipse plugin to create Eclipse project files
> that refer to an dependency A) with an Eclipse project link instead of
> B) as a JAR in the repo?  The dependency in this case is A) NOT a
> module of the parent project (where 'mvn eclipse:eclipse' is executed)
> and B) NOT built with Maven.
>
> Project links work well between modules in a multi-module project, and
> the -Declipse.workspace property provides some related functionality;
> but its workspace scan only seems to recognize other Maven projects.

You can't.

mvn eclipse:eclipse will automatically configure the .classpath to
reference any dependency that is already configured in Eclipse and is
a Maven project.

If you think about it, how do you expect eclipse:eclipse to work out
that your non-Maven project just happens to be the same as one of your
Maven dependencies?

> I am looking for something like -Declipse.workspace but more direct
> and fully contained within the plugin configuration: a map between
> dependencies and Eclipse projects that says, "when you are generating
> Eclipse project files and hit this dependency, refer to this Eclipse
> project instead of the artifact's JAR in the repo."
>
> The use case here is migrating one of an organization's existing
> builds to Maven while NOT migrating ALL an organization's builds.  We
> currently have a mix of Maven/non-Maven builds cohabitating in the
> same Eclipse workspace.  In this environment, dependencies from
> Maven-built projects to non-Maven-built projects appear twice:
> 1) as a JAR dependency and
> 2) as an Eclipse project where active development takes place.
>
> The duplicate project/class definition is causing confusion.

You have some of options:
1) Dont use mvn eclipse:eclipse
2) Use mvn eclipse:eclipse to "kick-start" the .classpath creation and
then manually tweak this to work with the non-Maven project.  You then
check-in the eclipse files: .project, .classpath into your source
control.
3) Migrate your non-Maven builds to Maven.  If these are Ant builds it
should be a simple process to create a dumb Maven wrapper that just
calls out to Ant to do the build.  This will give you a pom.xml that
specifies the correct dependency coordinates for mvn eclipse:eclipse
to then use.  Then when you are ready to migrate these projects, you
take out the Ant stuff and replace it with the equivalent Maven
plugins.

I would recommend 3).

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


Mime
View raw message