Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 2960 invoked from network); 27 Jun 2006 15:14:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jun 2006 15:14:23 -0000 Received: (qmail 3417 invoked by uid 500); 27 Jun 2006 15:14:17 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 3267 invoked by uid 500); 27 Jun 2006 15:14:16 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 3211 invoked by uid 99); 27 Jun 2006 15:14:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jun 2006 08:14:16 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jun 2006 08:14:14 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 467E51A983A; Tue, 27 Jun 2006 08:13:54 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r417485 - in /cocoon/trunk/tools/cocoon-maven-eclipse-plugin: ./ src/main/java/org/apache/maven/plugin/eclipse/ src/main/java/org/apache/maven/plugin/eclipse/writers/ src/test/java/org/apache/maven/plugin/eclipse/ src/test/java/org/apache/m... Date: Tue, 27 Jun 2006 15:13:52 -0000 To: cvs@cocoon.apache.org From: reinhard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060627151354.467E51A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: reinhard Date: Tue Jun 27 08:13:51 2006 New Revision: 417485 URL: http://svn.apache.org/viewvc?rev=417485&view=rev Log: merge with trunk: 415916:417477 Added: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponent15Writer.java - copied unchanged from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponent15Writer.java cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriterTest.java cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/ - copied from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/classpath - copied unchanged from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/classpath cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/org.eclipse.wst.common.component - copied unchanged from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/org.eclipse.wst.common.component cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/org.eclipse.wst.common.project.facet.core.xml - copied unchanged from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/org.eclipse.wst.common.project.facet.core.xml cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/pom.xml - copied unchanged from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/pom.xml cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/project - copied unchanged from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/project cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/src/ - copied from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/src/ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/src/main/ - copied from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/src/main/ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/src/main/java/ - copied from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/src/main/java/ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-20/src/main/java/DummyClass.txt - copied unchanged from r417484, maven/plugins/trunk/maven-eclipse-plugin/src/test/projects/project-20/src/main/java/DummyClass.txt Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/pom.xml cocoon/trunk/tools/cocoon-maven-eclipse-plugin/revision.txt cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractWtpResourceWriter.java cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponentWriter.java cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-19/ (props changed) Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/pom.xml URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/pom.xml?rev=417485&r1=417484&r2=417485&view=diff ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/pom.xml (original) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/pom.xml Tue Jun 27 08:13:51 2006 @@ -37,6 +37,11 @@ + commons-io + commons-io + 1.2 + + org.apache.maven maven-project 2.0.1 Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/revision.txt URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/revision.txt?rev=417485&r1=417484&r2=417485&view=diff ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/revision.txt (original) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/revision.txt Tue Jun 27 08:13:51 2006 @@ -1,3 +1,4 @@ +2006-06-27: merge with Revision 417477 (Reinhard) -------------------------------------------------------------------------- 2006-06-21: merge with Revision 415916 (Reinhard) -------------------------------------------------------------------------- @@ -15,8 +16,9 @@ -------------------------------------------------------------------------- merge command for cocoon-maven-eclipse-plugin: -TBD -svn merge -r [last-revision]:HEAD http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin +svn merge -r [last-revision]:HEAD https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin/ +(last revision currently is 417477) merge command for maven-eclipse-plugin: -svn merge -r 396513:HEAD http://svn.apache.org/repos/asf/cocoon/trunk/tools/cocoon-maven-eclipse-plugin \ No newline at end of file +svn merge -r [last-revision]:HEAD http://svn.apache.org/repos/asf/cocoon/trunk/tools/cocoon-maven-eclipse-plugin +(last-revision currently is 396513) \ No newline at end of file Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java?rev=417485&r1=417484&r2=417485&view=diff ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java (original) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipseCleanMojo.java Tue Jun 27 08:13:51 2006 @@ -53,11 +53,16 @@ private static final String DIR_DOT_SETTINGS = ".settings"; //$NON-NLS-1$ /** - * File name where the WTP component settings will be stored for our Eclipse Project. + * File name where the WTP component settings will be stored - WTP 1.0 name. */ private static final String FILE_DOT_COMPONENT = ".settings/.component"; //$NON-NLS-1$ /** + * File name where the WTP component settings will be stored - WTP 1.5 name. + */ + private static final String FILE_DOT_COMPONENT_15 = ".settings/org.eclipse.wst.common.component"; //$NON-NLS-1$ + + /** * File name where Eclipse Project's Facet configuration will be stored. */ private static final String FILE_FACET_CORE_XML = ".settings/org.eclipse.wst.common.project.facet.core.xml"; //$NON-NLS-1$ @@ -106,6 +111,7 @@ delete( new File( basedir, FILE_DOT_WTPMODULES ) ); delete( new File( basedir, FILE_DOT_COMPONENT ) ); + delete( new File( basedir, FILE_DOT_COMPONENT_15 ) ); delete( new File( basedir, FILE_FACET_CORE_XML ) ); File settingsDir = new File( basedir, DIR_DOT_SETTINGS ); Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java?rev=417485&r1=417484&r2=417485&view=diff ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java (original) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java Tue Jun 27 08:13:51 2006 @@ -31,6 +31,7 @@ import org.apache.maven.plugin.eclipse.writers.EclipseOSGiManifestWriter; import org.apache.maven.plugin.eclipse.writers.EclipseProjectWriter; import org.apache.maven.plugin.eclipse.writers.EclipseSettingsWriter; +import org.apache.maven.plugin.eclipse.writers.EclipseWtpComponent15Writer; import org.apache.maven.plugin.eclipse.writers.EclipseWtpComponentWriter; import org.apache.maven.plugin.eclipse.writers.EclipseWtpFacetsWriter; import org.apache.maven.plugin.eclipse.writers.EclipseWtpmodulesWriter; @@ -86,7 +87,7 @@ private static final String COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER = "org.eclipse.jdt.launching.JRE_CONTAINER"; //$NON-NLS-1$ // warning, order is important for binary search - public static final String[] WTP_SUPPORTED_VERSIONS = new String[] { "1.0", "R7", "none" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + public static final String[] WTP_SUPPORTED_VERSIONS = new String[] { "1.0", "1.5", "R7", "none" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ /** * Constant for 'artifactId' element in POM.xml. @@ -221,6 +222,11 @@ private boolean wtp10; /** + * Not a plugin parameter. Are we working with wtp 1.5? + */ + private boolean wtp15; + + /** * Not a plugin parameter. Is this a java project? */ private boolean isJavaProject; @@ -442,6 +448,10 @@ { wtp10 = true; } + else if ( "1.5".equalsIgnoreCase( wtpversion ) ) //$NON-NLS-1$ + { + wtp15 = true; + } if ( !"none".equalsIgnoreCase( wtpversion ) ) { getLog().info( Messages.getString( "EclipsePlugin.wtpversion", wtpversion ) ); @@ -537,14 +547,25 @@ localRepository, buildOutputDirectory ); } - else if ( wtp10 ) + + if ( wtp10 || wtp15 ) { new EclipseWtpFacetsWriter( getLog(), eclipseProjectDir, project, deps ).write( sourceDirs, localRepository, buildOutputDirectory ); + } + if ( wtp10 ) + { + new EclipseWtpComponentWriter( getLog(), eclipseProjectDir, project, deps ).write( sourceDirs, localRepository, buildOutputDirectory ); + } + if ( wtp15 ) + { + new EclipseWtpComponent15Writer( getLog(), eclipseProjectDir, project, deps ).write( sourceDirs, + localRepository, + buildOutputDirectory ); } new EclipseProjectWriter( getLog(), eclipseProjectDir, project, deps ).write( projectBaseDir, executedProject, Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractWtpResourceWriter.java URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractWtpResourceWriter.java?rev=417485&r1=417484&r2=417485&view=diff ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractWtpResourceWriter.java (original) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractWtpResourceWriter.java Tue Jun 27 08:13:51 2006 @@ -55,6 +55,8 @@ protected static final String ATTR_MODULE_ID = "id"; //$NON-NLS-1$ + protected static final String ATTR_PROJECT_VERSION = "project-version"; //$NON-NLS-1$ + protected static final String ELT_PROJECT_MODULES = "project-modules"; //$NON-NLS-1$ protected static final String ARTIFACT_MAVEN_WAR_PLUGIN = "maven-war-plugin"; //$NON-NLS-1$ Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponentWriter.java URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponentWriter.java?rev=417485&r1=417484&r2=417485&view=diff ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponentWriter.java (original) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponentWriter.java Tue Jun 27 08:13:51 2006 @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.eclipse.writers; - /* * Copyright 2001-2005 The Apache Software Foundation. * @@ -16,6 +14,8 @@ * limitations under the License. */ +package org.apache.maven.plugin.eclipse.writers; + import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -43,6 +43,9 @@ extends AbstractWtpResourceWriter { + /** + * Context root attribute. + */ private static final String ATTR_CONTEXT_ROOT = "context-root"; //$NON-NLS-1$ /** @@ -52,8 +55,21 @@ /** * File name where the WTP component settings will be stored for our Eclipse Project. + * @return .component */ - private static final String FILE_DOT_COMPONENT = ".component"; //$NON-NLS-1$ + protected String getComponentFileName() + { + return ".component"; //$NON-NLS-1$ + } + + /** + * Version number added to component configuration. + * @return 1.0 + */ + protected String getProjectVersion() + { + return null; + } public EclipseWtpComponentWriter( Log log, File eclipseProjectDir, MavenProject project, IdeDependency[] deps ) { @@ -71,7 +87,7 @@ FileWriter w; try { - w = new FileWriter( new File( settingsDir, FILE_DOT_COMPONENT ) ); + w = new FileWriter( new File( settingsDir, getComponentFileName() ) ); } catch ( IOException ex ) { @@ -87,12 +103,12 @@ } /** - * Writes out the module type settings for a Web Tools Project to a {@link #FILE_DOT_COMPONENT}. + * Writes out the module type settings for a Web Tools Project to a component file. * * @param writer * @param packaging * @param buildOutputDirectory - * @param referencedReactorArtifacts + * @param sourceDirs * @param localRepository * @throws MojoExecutionException */ @@ -102,6 +118,10 @@ { writer.startElement( ELT_PROJECT_MODULES ); writer.addAttribute( ATTR_MODULE_ID, "moduleCoreId" ); //$NON-NLS-1$ + if ( getProjectVersion() != null ) + { + writer.addAttribute( ATTR_PROJECT_VERSION, getProjectVersion() ); + } writer.startElement( ELT_WB_MODULE ); writer.addAttribute( ATTR_DEPLOY_NAME, getProject().getArtifactId() ); Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java?rev=417485&r1=417484&r2=417485&view=diff ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java (original) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/AbstractEclipsePluginTestCase.java Tue Jun 27 08:13:51 2006 @@ -160,6 +160,14 @@ new File( projectOutputDir, ".settings/.component" ) ); } + // WTP15 + File component15ExpectedFile = new File( basedir, "org.eclipse.wst.common.component" ); + if ( component15ExpectedFile.exists() ) + { + assertFileEquals( localRepositoryDir.getCanonicalPath(), component15ExpectedFile, + new File( projectOutputDir, ".settings/org.eclipse.wst.common.component" ) ); + } + } protected void assertFileEquals( String mavenRepo, File expectedFile, File actualFile ) Modified: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java?rev=417485&r1=417484&r2=417485&view=diff ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java (original) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java Tue Jun 27 08:13:51 2006 @@ -183,4 +183,14 @@ testProject( "project-19" ); } + /** + * WTP 1.5 changes in wtpmodules. + * @throws Exception any exception thrown during test + */ + public void testProject20() + throws Exception + { + testProject( "project-20" ); + } + } Added: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriterTest.java URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriterTest.java?rev=417485&view=auto ============================================================================== --- cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriterTest.java (added) +++ cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriterTest.java Tue Jun 27 08:13:51 2006 @@ -0,0 +1,30 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed 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. + */ +package org.apache.maven.plugin.eclipse.writers; + +import java.io.File; + +import junit.framework.TestCase; + +public class EclipseOSGiManifestWriterTest extends TestCase +{ + + public void testFileParsing() throws Exception { + EclipseOSGiManifestWriter writer = new EclipseOSGiManifestWriter(null, null, null, null); + System.out.println(writer.rewriteManifest(new File("F:/os/cocoon/c30/core/cocoon-core/META-INF/MANIFEST.MF"), "lib")); + } + +} Propchange: cocoon/trunk/tools/cocoon-maven-eclipse-plugin/src/test/projects/project-19/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Jun 27 08:13:51 2006 @@ -1,3 +1,5 @@ + .project .classpath target +resourceoutput