Return-Path: X-Original-To: apmail-maven-commits-archive@www.apache.org Delivered-To: apmail-maven-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 432E6661D for ; Wed, 27 Jul 2011 21:13:21 +0000 (UTC) Received: (qmail 53886 invoked by uid 500); 27 Jul 2011 21:13:20 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 53747 invoked by uid 500); 27 Jul 2011 21:13:20 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 53740 invoked by uid 99); 27 Jul 2011 21:13:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 21:13:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 21:13:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 35C3723888BD; Wed, 27 Jul 2011 21:12:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1151629 - in /maven/plugins/trunk/maven-eclipse-plugin: ./ src/it/ src/it/MECLIPSE-692/ src/it/MECLIPSE-692/jar-module/ src/it/MECLIPSE-692/pom-module/ src/it/MECLIPSE-692/war-module/ src/main/java/org/apache/maven/plugin/eclipse/ Date: Wed, 27 Jul 2011 21:12:53 -0000 To: commits@maven.apache.org From: rfscholte@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110727211258.35C3723888BD@eris.apache.org> Author: rfscholte Date: Wed Jul 27 21:12:19 2011 New Revision: 1151629 URL: http://svn.apache.org/viewvc?rev=1151629&view=rev Log: Fix MECLIPSE-692: .project contains projects which were skipped during reactor build Introducing maven-invoker-plugin Added: maven/plugins/trunk/maven-eclipse-plugin/src/it/ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/invoker.properties maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/jar-module/ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/jar-module/pom.xml maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom-module/ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom-module/pom.xml maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom.xml maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/verify.bsh maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/war-module/ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/war-module/pom.xml maven/plugins/trunk/maven-eclipse-plugin/src/it/settings.xml Modified: maven/plugins/trunk/maven-eclipse-plugin/pom.xml maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java Modified: maven/plugins/trunk/maven-eclipse-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/pom.xml?rev=1151629&r1=1151628&r2=1151629&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-eclipse-plugin/pom.xml Wed Jul 27 21:12:19 2011 @@ -330,6 +330,26 @@ under the License. org.apache.maven.plugins + maven-invoker-plugin + 1.5 + + + integration-test + + install + run + + + + + ${project.build.directory}/it + verify + ${project.build.directory}/local-repo + src/it/settings.xml + + + + org.apache.maven.plugins maven-failsafe-plugin 2.9 Added: maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/invoker.properties?rev=1151629&view=auto ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/invoker.properties (added) +++ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/invoker.properties Wed Jul 27 21:12:19 2011 @@ -0,0 +1 @@ +invoker.goals = clean eclipse:eclipse \ No newline at end of file Added: maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/jar-module/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/jar-module/pom.xml?rev=1151629&view=auto ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/jar-module/pom.xml (added) +++ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/jar-module/pom.xml Wed Jul 27 21:12:19 2011 @@ -0,0 +1,12 @@ + + 4.0.0 + + + org.apache.maven.plugins.it + parent-meclipse-692 + 0.0.1-SNAPSHOT + + + jardep-meclipse-692 + + \ No newline at end of file Added: maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom-module/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom-module/pom.xml?rev=1151629&view=auto ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom-module/pom.xml (added) +++ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom-module/pom.xml Wed Jul 27 21:12:19 2011 @@ -0,0 +1,21 @@ + + 4.0.0 + + + org.apache.maven.plugins.it + parent-meclipse-692 + 0.0.1-SNAPSHOT + + + pomdep-meclipse-692 + pom + + + + junit + junit + 4.8.2 + test + + + \ No newline at end of file Added: maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom.xml?rev=1151629&view=auto ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom.xml (added) +++ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/pom.xml Wed Jul 27 21:12:19 2011 @@ -0,0 +1,30 @@ + + 4.0.0 + org.apache.maven.plugins.it + parent-meclipse-692 + 0.0.1-SNAPSHOT + pom + + + + + org.apache.maven.plugins + maven-eclipse-plugin + @project.version@ + + + + eclipse + + + + + + + + + war-module + jar-module + pom-module + + \ No newline at end of file Added: maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/verify.bsh URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/verify.bsh?rev=1151629&view=auto ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/verify.bsh (added) +++ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/verify.bsh Wed Jul 27 21:12:19 2011 @@ -0,0 +1,71 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.*; +import java.util.*; +import java.util.jar.*; +import org.codehaus.plexus.util.*; + +boolean result = true; + +try +{ + File jarModuleDotProject = new File( basedir, "jar-module/.project"); + if( !jarModuleDotProject.exists() ) + { + System.err.println( "Expected jar-module/.project, but file doesn't exist" ); + return false; + } + + File pomModuleDotProject = new File( basedir, "pom-module/.project"); + if( pomModuleDotProject.exists() ) + { + System.err.println( "Did not expected pom-module/.project, but file exists" ); + return false; + } + + File warModuleDotProject = new File( basedir, "war-module/.project"); + if( !warModuleDotProject.exists() ) + { + System.err.println( "Expected war-module/.project, but file doesn't exist" ); + return false; + } + + String dotProjectContent = FileUtils.fileRead( warModuleDotProject, "UTF-8" ); + if ( dotProjectContent.indexOf( "jardep-meclipse-692" ) < 0 ) + { + System.err.println( "Expected war-module/.project to contains 'jardep-meclipse-692', but it didn't" ); + return false; + } + + String dotProjectContent = FileUtils.fileRead( warModuleDotProject, "UTF-8" ); + if ( dotProjectContent.indexOf( "pomdep-meclipse-692" ) >= 0 ) + { + System.err.println( "Expected war-module/.project to not contain 'pomdep-meclipse-692', but it did" ); + return false; + } + +} +catch ( Exception e) +{ + e.printStackTrace(); + result = false; +} +return result; \ No newline at end of file Added: maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/war-module/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/war-module/pom.xml?rev=1151629&view=auto ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/war-module/pom.xml (added) +++ maven/plugins/trunk/maven-eclipse-plugin/src/it/MECLIPSE-692/war-module/pom.xml Wed Jul 27 21:12:19 2011 @@ -0,0 +1,39 @@ + + 4.0.0 + + + org.apache.maven.plugins.it + parent-meclipse-692 + 0.0.1-SNAPSHOT + + + war-meclipse-692 + war + + + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + false + + + + + + + + org.apache.maven.plugins.it + pomdep-meclipse-692 + 0.0.1-SNAPSHOT + pom + + + org.apache.maven.plugins.it + jardep-meclipse-692 + 0.0.1-SNAPSHOT + + + \ No newline at end of file Added: maven/plugins/trunk/maven-eclipse-plugin/src/it/settings.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/it/settings.xml?rev=1151629&view=auto ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/it/settings.xml (added) +++ maven/plugins/trunk/maven-eclipse-plugin/src/it/settings.xml Wed Jul 27 21:12:19 2011 @@ -0,0 +1,55 @@ + + + + + + + + it-repo + + true + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java?rev=1151629&r1=1151628&r2=1151629&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java Wed Jul 27 21:12:19 2011 @@ -1981,6 +1981,19 @@ public class EclipsePlugin } /** + * Utility method that locates a project producing the given artifact + * and verifies if it's a valid Eclipse project. + * + * @param artifact the artifact a project should produce. + * @return true if the artifact is produced by a reactor projectart. + */ + protected boolean isAvailableAsAReactorProject( Artifact artifact ) + { + MavenProject project = getReactorProject( artifact ); + return ( project != null && new File( project.getBasedir(), ".project" ).exists() ) ; + } + + /** * Utility method that locates a project in the workspace for the given artifact. * * @param artifact the artifact a project should produce.