Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5AF829E38 for ; Tue, 5 Jun 2012 16:00:33 +0000 (UTC) Received: (qmail 30595 invoked by uid 500); 5 Jun 2012 16:00:31 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 30537 invoked by uid 500); 5 Jun 2012 16:00:31 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 30529 invoked by uid 99); 5 Jun 2012 16:00:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 16:00:31 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of chris.redekop@gmail.com designates 209.85.161.171 as permitted sender) Received: from [209.85.161.171] (HELO mail-gg0-f171.google.com) (209.85.161.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 16:00:23 +0000 Received: by ggmi1 with SMTP id i1so5148788ggm.30 for ; Tue, 05 Jun 2012 09:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=QYzKYP8UWTHQIwODXfHUgpGxWvo1ubUK/RB7ODZrTfE=; b=cKDE7Uvw1TrI4DvFgQno6zIeGVOT+DT1FOgjV2d0epAlA3H5VXaZOSKX6OoI4fn+NL rBP4E3xY6lqKKGCyHvYUCL8++LhfCpKJ46ZNrRqn3+h7+6rPYTIZ7xEpcf84QnbwTOL8 iqjO2QZbuHfDXrUcR5Ho7kXmitrvCEPiScwTJlq+Eqiigt46ipdAR07hhFTg1llmiRvw o4sNEGHljCY2LjUItxyJGDo67OTtky6c/mp1nIa18za9GOD0+VENM0JFL4qMfT9Bb0XG EHIKkhcyh0GV5WreFClaXO8QvnMt5FLI9dmPAIW+AnMRpQZ/r3FW3tOefJvf1qP5XGF9 LCmQ== MIME-Version: 1.0 Received: by 10.182.197.69 with SMTP id is5mr16646819obc.32.1338912001877; Tue, 05 Jun 2012 09:00:01 -0700 (PDT) Received: by 10.182.78.36 with HTTP; Tue, 5 Jun 2012 09:00:01 -0700 (PDT) In-Reply-To: References: Date: Tue, 5 Jun 2012 12:00:01 -0400 Message-ID: Subject: Re: Eclipse Plugin and Project Links to Independent Projects From: Chris Redekop To: Maven Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Jun 4, 2012 at 8:08 PM, Barrie Treloar wrote: > On Tue, Jun 5, 2012 at 3:19 AM, Chris Redekop w= rote: >> (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? =A0The 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. Thanks for the confirmation, Barrie. I figured that this is currently not supported, but part of me wondered if I just hadn't found the right (combination of) options. > > 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? The most straight-forward way that I can think of is a new plugin configuration: a map of dependency -> project. When the Eclipse plugin handles a dependency, in can first check the map. If there is an entry, then the specified project is used; otherwise, the JAR is used. The old Maven 1 plugin had something like this, in the form of a "project" = flag: http://maven.apache.org/maven-1.x/plugins/eclipse/faq.html#project_dependen= cies > >> 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. =A0We >> currently have a mix of Maven/non-Maven builds cohabitating in the >> same Eclipse workspace. =A0In 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. =A0You then > check-in the eclipse files: .project, .classpath into your source > control. Both of these run counter to DRY: maintaining dependencies in POMs and Eclipse project files. Do not want. > 3) Migrate your non-Maven builds to Maven. =A0If 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. =A0This will give you a pom.xml that > specifies the correct dependency coordinates for mvn eclipse:eclipse > to then use. =A0Then 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). The use case of a mixed-build environment will be valid into the foreseeable future. 3) is not an option. A fourth option would enhance the plugin to support a map configuration as described here. It *seems* straightforward to me at this point, but the history of a similar feature disappearing from the Maven 1 plugin makes me wonder: maybe this is a Bad Idea? Comments? > --------------------------------------------------------------------- > 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