Author: baerrach
Date: Mon Sep 22 20:41:24 2008
New Revision: 698085
URL: http://svn.apache.org/viewvc?rev=698085&view=rev
Log:
[MECLIPSE-493] Automatically locate workspace
Eclispe Plugin
- workspace type changes from String to File
- getWorkspaceConfiguration() now locates the workspace if it is null.
ReadWorkspaceLocations
- exposed some constants needed outside of class
- getProjectLocation()
- now package scoped for unit testing
- rewrote internals to read in the URI string inside ".location" file
- now closes stream
- readArtefact() now takes projectLocation as File instead of String
- readAvailableJREs() returns null if no prefs file exists and a workspace was
located.
This causes the defaultJre to be used.
TempEclipseWorkspace
- added test fixtures used in TestCases.
- usePathToProject changed to which projects inside the workspace should be
linked in the metadata/
This value was only null to avoid re-initializing the internal workspaces,
which test fixtures resolves.
- Removed localizedIndicator as static test fixtures are configured once at
class load time and
regenerating these files each test run is not a large burden. However
misconfuration of the test files
and not regenerating was a source of errors during creation of extra ITs.
- Refactored out writeLocationFile()
- Deleted getWorkspaceLocation() as the variable is public.
AbstractEclipsePluginIT
- Added testProject( File basedir ) for ITs running inside the test eclipse
workspaces.
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/reader/
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocationsTest.java
(with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/.metadata/.plugins/org.eclipse.core.runtime/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A1/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A1/pom.xml
(with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A2/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A2/pom.xml
(with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/pom.xml
(with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.classpath
(with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.project
(with props)
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/pom.xml
(with props)
Modified:
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-36/pom.xml
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=698085&r1=698084&r2=698085&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
Mon Sep 22 20:41:24 2008
@@ -483,10 +483,12 @@
* settings as the reactor projects, but the project name template my
differ. The pom's in the workspace projects
* may not contain variables in the artefactId, groupId and version tags.
*
+ * If workspace is not defined, then an attempt to locate it by checking
up the directory hierarchy will be made.
+ *
* @since 2.5
* @parameter expression="${eclipse.workspace}"
*/
- protected String workspace;
+ protected File workspace;
/**
* Limit the use of project references to the current workspace. No
project references will be created to projects
@@ -1701,15 +1703,37 @@
if ( workspaceConfiguration == null )
{
workspaceConfiguration = new WorkspaceConfiguration();
- if ( workspace != null )
- {
- workspaceConfiguration.setWorkspaceDirectory( new File(
workspace ) );
- }
+ locateWorkspace();
+ workspaceConfiguration.setWorkspaceDirectory( workspace );
+
new ReadWorkspaceLocations().init( getLog(),
workspaceConfiguration, project, wtpdefaultserver );
}
return workspaceConfiguration;
}
+ /**
+ * If workspace is not defined, then attempt to locate it by checking up
the directory hierarchy.
+ */
+ private void locateWorkspace()
+ {
+ if ( workspace == null )
+ {
+ File currentWorkingDirectory = new File( "." ).getAbsoluteFile();
+ while ( currentWorkingDirectory != null )
+ {
+ File metadataDirectory = new File( currentWorkingDirectory,
".metadata" );
+ logger.debug( "Checking metadataDirectory = " +
currentWorkingDirectory );
+ if ( metadataDirectory.exists() &&
metadataDirectory.isDirectory() )
+ {
+ logger.debug( " Found" );
+ workspace = currentWorkingDirectory;
+ return;
+ }
+ currentWorkingDirectory =
currentWorkingDirectory.getParentFile();
+ }
+ }
+ }
+
public List getExcludes()
{
return excludes;
Modified:
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java?rev=698085&r1=698084&r2=698085&view=diff
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java
(original)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java
Mon Sep 22 20:41:24 2008
@@ -20,6 +20,8 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
@@ -34,6 +36,7 @@
import org.apache.maven.plugin.ide.IdeUtils;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -48,9 +51,9 @@
public class ReadWorkspaceLocations
{
- private static final String BINARY_LOCATION_FILE = ".location";
+ public static final String BINARY_LOCATION_FILE = ".location";
- private static final String
METADATA_PLUGINS_ORG_ECLIPSE_CORE_RESOURCES_PROJECTS =
+ public static final String
METADATA_PLUGINS_ORG_ECLIPSE_CORE_RESOURCES_PROJECTS =
".metadata/.plugins/org.eclipse.core.resources/.projects";
private static final String[] PARENT_VERSION = new String[] { "parent",
"version" };
@@ -229,52 +232,44 @@
* @param workspaceLocation the location of the workspace
* @param project the project subdirectory in the metadata
* @return the full path to the project.
+ * @throws IOException failures to read location file
+ * @throws URISyntaxException failures to read location file
*/
- private String getProjectLocation( File workspaceLocation, File project )
+ /* package */File getProjectLocation( File workspaceLocation, File project
)
+ throws IOException, URISyntaxException
{
- String projectLocation = null;
File location = new File( project,
ReadWorkspaceLocations.BINARY_LOCATION_FILE );
if ( location.exists() )
{
+ SafeChunkyInputStream fileInputStream = null;
try
{
- SafeChunkyInputStream fileInputStream = new
SafeChunkyInputStream( location );
+ fileInputStream = new SafeChunkyInputStream( location );
DataInputStream dataInputStream = new DataInputStream(
fileInputStream );
String file = dataInputStream.readUTF().trim();
if ( file.length() > 0 )
{
- file = file.substring( file.indexOf( ':' ) + 1 );
- while ( !Character.isLetterOrDigit( file.charAt( 0 ) ) )
+ if ( !file.startsWith( "URI//" ) )
{
- file = file.substring( 1 );
+ throw new IOException( location.getAbsolutePath() + "
contains unexpected data: " + file);
}
- if ( file.indexOf( ':' ) < 0 )
- {
- file = File.separator + file;
- }
- projectLocation = file;
+ file = file.substring( "URI//".length() );
+ return new File( new URI( file ) );
}
-
}
- catch ( FileNotFoundException e )
+ finally
{
- projectLocation = "unknown";
- }
- catch ( IOException e )
- {
- projectLocation = "unknown";
+ IOUtil.close( fileInputStream );
}
}
- if ( projectLocation == null )
+ File projectBase = new File( workspaceLocation, project.getName() );
+ if ( projectBase.isDirectory() )
{
- File projectBase = new File( workspaceLocation, project.getName()
);
- if ( projectBase.isDirectory() )
- {
- projectLocation = projectBase.getAbsolutePath();
- }
+ return projectBase;
}
- return projectLocation;
+
+ return null;
}
/**
@@ -318,17 +313,17 @@
* @throws XmlPullParserException
* @throws IOException
*/
- private IdeDependency readArtefact( String projectLocation, Log logger )
+ private IdeDependency readArtefact( File projectLocation, Log logger )
throws FileNotFoundException, XmlPullParserException, IOException
{
- File projectFile = new File( new File( projectLocation ), ".project" );
- String eclipseProjectName = new File( projectLocation ).getName();
+ File projectFile = new File( projectLocation, ".project" );
+ String eclipseProjectName = projectLocation.getName();
if ( projectFile.exists() )
{
Xpp3Dom project = Xpp3DomBuilder.build( new FileReader(
projectFile ) );
eclipseProjectName = getValue( project, new String[] { "name" },
eclipseProjectName );
}
- File pomFile = new File( new File( projectLocation ), "pom.xml" );
+ File pomFile = new File( projectLocation, "pom.xml" );
if ( pomFile.exists() )
{
Xpp3Dom pom = Xpp3DomBuilder.build( new FileReader( pomFile ) );
@@ -343,13 +338,13 @@
String packaging = getValue( pom,
ReadWorkspaceLocations.PACKAGING, "jar" );
logger.debug( "found workspace artefact " + group + ":" + artifact
+ ":" + version + " " + packaging + " ("
- + eclipseProjectName + ")" + " -> " + projectLocation );
+ + eclipseProjectName + ")" + " -> " +
projectLocation.getAbsolutePath() );
return new IdeDependency( group, artifact, version, packaging,
true, false, false, false, false, null,
packaging, false, null, 0,
eclipseProjectName );
}
else
{
- logger.debug( "ignored workspace project NO pom available " +
projectLocation );
+ logger.debug( "ignored workspace project NO pom available " +
projectLocation.getAbsolutePath() );
return null;
}
}
@@ -406,14 +401,6 @@
*/
private HashMap readAvailableJREs( File workspaceLocation, Log logger )
{
- HashMap jreMap = new HashMap();
- jreMap.put( "1.2", CLASSPATHENTRY_STANDARD + "J2SE-1.2" );
- jreMap.put( "1.3", CLASSPATHENTRY_STANDARD + "J2SE-1.3" );
- jreMap.put( "1.4", CLASSPATHENTRY_STANDARD + "J2SE-1.4" );
- jreMap.put( "1.5", CLASSPATHENTRY_STANDARD + "J2SE-1.5" );
- jreMap.put( "5", jreMap.get( "1.5" ) );
- jreMap.put( "1.6", CLASSPATHENTRY_STANDARD + "JavaSE-1.6" );
- jreMap.put( "6", jreMap.get( "1.6" ) );
Xpp3Dom vms;
try
{
@@ -422,7 +409,7 @@
ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_LAUNCHING_PREFS
);
if ( !prefs.exists() )
{
- return jreMap;
+ return null;
}
Properties properties = new Properties();
properties.load( new FileInputStream( prefs ) );
@@ -433,8 +420,17 @@
catch ( Exception e )
{
logger.error( "Could not read workspace JRE preferences", e );
- return jreMap;
+ return null;
}
+
+ HashMap jreMap = new HashMap();
+ jreMap.put( "1.2", CLASSPATHENTRY_STANDARD + "J2SE-1.2" );
+ jreMap.put( "1.3", CLASSPATHENTRY_STANDARD + "J2SE-1.3" );
+ jreMap.put( "1.4", CLASSPATHENTRY_STANDARD + "J2SE-1.4" );
+ jreMap.put( "1.5", CLASSPATHENTRY_STANDARD + "J2SE-1.5" );
+ jreMap.put( "5", jreMap.get( "1.5" ) );
+ jreMap.put( "1.6", CLASSPATHENTRY_STANDARD + "JavaSE-1.6" );
+ jreMap.put( "6", jreMap.get( "1.6" ) );
String defaultJRE = vms.getAttribute( "defaultVM" ).trim();
Xpp3Dom[] vmTypes = vms.getChildren( "vmType" );
for ( int vmTypeIndex = 0; vmTypeIndex < vmTypes.length; vmTypeIndex++
)
@@ -493,7 +489,7 @@
*/
private void readWorkspace( WorkspaceConfiguration workspaceConfiguration,
Log logger )
{
- ArrayList dependencys = new ArrayList();
+ ArrayList dependencies = new ArrayList();
if ( workspaceConfiguration.getWorkspaceDirectory() != null )
{
File workspace =
@@ -508,24 +504,24 @@
{
try
{
- String projectLocation =
+ File projectLocation =
getProjectLocation(
workspaceConfiguration.getWorkspaceDirectory(), project );
if ( projectLocation != null )
{
IdeDependency ideDependency = readArtefact(
projectLocation, logger );
if ( ideDependency != null )
{
- dependencys.add( ideDependency );
+ dependencies.add( ideDependency );
}
}
}
catch ( Exception e )
{
- logger.warn( "could not read workspace project:" +
project );
+ logger.warn( "could not read workspace project:" +
project, e );
}
}
}
}
- workspaceConfiguration.setWorkspaceArtefacts( (IdeDependency[])
dependencys.toArray( new IdeDependency[dependencys.size()] ) );
+ workspaceConfiguration.setWorkspaceArtefacts( (IdeDependency[])
dependencies.toArray( new IdeDependency[dependencies.size()] ) );
}
}
Modified:
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java?rev=698085&r1=698084&r2=698085&view=diff
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java
(original)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java
Mon Sep 22 20:41:24 2008
@@ -6,16 +6,83 @@
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.util.Properties;
+import org.apache.maven.plugin.eclipse.reader.ReadWorkspaceLocations;
+import org.codehaus.plexus.util.IOUtil;
import org.eclipse.core.internal.localstore.ILocalStoreConstants;
public class TempEclipseWorkspace
{
+ private static TempEclipseWorkspace rad7WithDefault14;
+
+ private static TempEclipseWorkspace eclipseWithDefault15;
+
+ private static TempEclipseWorkspace eclipseWithDefault13;
+
+ private static TempEclipseWorkspace dynamicWorkspace;
+
+ /**
+ * @return RAD 7 workspace, JDK 14, includes projects: "direct-compile"
+ * @throws Exception
+ */
+ public static TempEclipseWorkspace
getFixtureEclipseWorkspaceWithRad7Default14()
+ throws Exception
+ {
+ if ( rad7WithDefault14 == null )
+ {
+ rad7WithDefault14 = new TempEclipseWorkspace( "rad7WithDefault14",
new String[] { "direct-compile" } );
+ }
+ return rad7WithDefault14;
+ }
+
+ /**
+ * @return Eclipse workspace, JDK 1.5, includes projects: "direct-compile".
+ * @throws Exception
+ */
+ public static TempEclipseWorkspace getFixtureEclipseWithDefault15()
+ throws Exception
+ {
+ if ( eclipseWithDefault15 == null )
+ {
+ eclipseWithDefault15 = new TempEclipseWorkspace(
"eclipseWithDefault15", new String[] { "direct-compile" } );
+ }
+ return eclipseWithDefault15;
+ }
+
+ /**
+ * @return Eclipse workspace, JDK 1.3, includes projects: "direct-compile"
+ * @throws Exception
+ */
+ public static TempEclipseWorkspace getFixtureEclipseWithDefault13()
+ throws Exception
+ {
+ if ( eclipseWithDefault13 == null )
+ {
+ eclipseWithDefault13 = new TempEclipseWorkspace(
"eclipseWithDefault13", new String[] { "direct-compile" } );
+ }
+ return eclipseWithDefault13;
+ }
+
+ /**
+ * @return Eclipse workspace, JDK 1.4, includes projects:
"project-A/module-A1", "../project-O"
+ * @throws Exception
+ */
+ public static TempEclipseWorkspace getFixtureEclipseDynamicWorkspace()
+ throws Exception
+ {
+ if ( dynamicWorkspace == null )
+ {
+ dynamicWorkspace =
+ new TempEclipseWorkspace( "dynamicWorkspace", new String[] {
"project-A/module-A1", "../project-O" } );
+ }
+ return dynamicWorkspace;
+ }
public File workspaceLocation;
- public TempEclipseWorkspace( String testWorkspaceName, boolean
usePathToProject )
+ public TempEclipseWorkspace( String testWorkspaceName, String[]
projectsToLink )
throws Exception
{
@@ -25,39 +92,54 @@
workspaceLocation = new File( eclipseLocation, testWorkspaceName +
"/workspace" ).getCanonicalFile();
- File localizedIndicator = new File( workspaceLocation, ".localized" );
- if ( !localizedIndicator.exists() )
- {
- File propertyfile =
- new File( workspaceLocation,
-
".metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs"
);
+ File propertyfile =
+ new File( workspaceLocation,
+
".metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs"
);
- preparePropertyFile( jdkLocation, propertyfile );
+ preparePropertyFile( jdkLocation, propertyfile );
- String projectLocation;
- if ( usePathToProject )
- {
- projectLocation = "URI//file:" + ( new File(
workspaceLocation, "direct-compile" ).getCanonicalPath() );
- }
- else
+ if ( projectsToLink != null && projectsToLink.length != 0 )
+ {
+ for ( int i = 0; i < projectsToLink.length; i++ )
{
- projectLocation = "";
+ String projectToLink = projectsToLink[i];
+ writeLocationFile( projectToLink );
}
- FileOutputStream location =
- new FileOutputStream(
- new File( workspaceLocation,
-
".metadata/.plugins/org.eclipse.core.resources/.projects/direct-compile/.location"
) );
- DataOutputStream dataOutputStream = new DataOutputStream( location
);
- dataOutputStream.write( ILocalStoreConstants.BEGIN_CHUNK );
- dataOutputStream.writeUTF( projectLocation );
- dataOutputStream.write( ILocalStoreConstants.END_CHUNK );
- dataOutputStream.close();
- location.close();
- localizedIndicator.createNewFile();
}
}
+ /**
+ * Given the relative path from the workspace to the project to link use
the basename as the project name and link
+ * this project to the fully qualified path anchored at workspaceLocation.
+ *
+ * @param projectToLink
+ * @throws MalformedURLException
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ private void writeLocationFile( String projectToLink )
+ throws MalformedURLException, FileNotFoundException, IOException
+ {
+ File projectToLinkAsRelativeFile = new File( projectToLink );
+
+ File projectWorkspaceDirectory =
+ new File( workspaceLocation, projectToLinkAsRelativeFile.getPath()
).getCanonicalFile();
+ String uriToProjectWorkspaceDirectory = "URI//" +
projectWorkspaceDirectory.toURI().toURL().toString();
+
+ File metaDataPlugins =
+ new File( workspaceLocation,
ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RESOURCES_PROJECTS );
+ File projectMetaDataDirectory = new File( metaDataPlugins,
projectToLinkAsRelativeFile.getName() );
+ File locationFile = new File( projectMetaDataDirectory,
ReadWorkspaceLocations.BINARY_LOCATION_FILE );
+
+ DataOutputStream dataOutputStream = new DataOutputStream( new
FileOutputStream( locationFile ) );
+
+ dataOutputStream.write( ILocalStoreConstants.BEGIN_CHUNK );
+ dataOutputStream.writeUTF( uriToProjectWorkspaceDirectory );
+ dataOutputStream.write( ILocalStoreConstants.END_CHUNK );
+ IOUtil.close( dataOutputStream );
+ }
+
private static void preparePropertyFile( File jdkLocation, File
propertyfile )
throws IOException, FileNotFoundException
{
@@ -73,8 +155,4 @@
properties.store( new FileOutputStream( propertyfile ), "" );
}
- public File getWorkspaceLocation()
- {
- return workspaceLocation;
- }
}
Modified:
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java?rev=698085&r1=698084&r2=698085&view=diff
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java
(original)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java
Mon Sep 22 20:41:24 2008
@@ -163,18 +163,19 @@
+ "\n" );
// Hack: to work around proxys and DTDs retrievals.
- EntityResolver ignoreDtds = new EntityResolver() {
+ EntityResolver ignoreDtds = new EntityResolver()
+ {
public InputSource resolveEntity( String publicId, String
systemId )
throws SAXException, IOException
{
- return new InputSource(new StringReader("<!ELEMENT
ignored (#PCDATA)>"));
+ return new InputSource( new StringReader( "<!ELEMENT
ignored (#PCDATA)>" ) );
}
-
- };
+
+ };
XMLUnit.setTestEntityResolver( ignoreDtds );
XMLUnit.setControlEntityResolver( ignoreDtds );
-
+
installed = true;
}
}
@@ -222,20 +223,18 @@
{
testProject( projectName, new Properties(), "clean", "eclipse" );
}
-
+
/**
* Execute the eclipse:eclipse goal on a test project and verify generated
files.
*
- * @param projectName project directory
- * @param properties additional properties
+ * @param basedir basedir of mvn execution
* @throws Exception any exception generated during test
- * @deprecated Use [EMAIL PROTECTED]
#testProject(String,Properties,String,String)} instead
*/
- protected void testProject( String projectName, Properties properties )
+ protected void testProject( File basedir )
throws Exception
{
- testProject( projectName, properties, "clean", "eclipse" );
- }
+ testProject( basedir, new Properties(), "clean", "eclipse" );
+ }
/**
* Execute the eclipse:eclipse goal on a test project and verify generated
files.
@@ -250,7 +249,21 @@
throws Exception
{
File basedir = getTestFile( "target/test-classes/projects/" +
projectName );
+ testProject( basedir, properties, cleanGoal, genGoal );
+ }
+ /**
+ * Execute the eclipse:eclipse goal on a test project and verify generated
files.
+ *
+ * @param basedir basedir of mvn execution
+ * @param properties additional properties
+ * @param cleanGoal TODO
+ * @param genGoal TODO
+ * @throws Exception any exception generated during test
+ */
+ protected void testProject( File basedir, Properties properties, String
cleanGoal, String genGoal )
+ throws Exception
+ {
File pom = new File( basedir, "pom.xml" );
String pluginSpec = getPluginCLISpecification();
Modified:
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java?rev=698085&r1=698084&r2=698085&view=diff
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java
(original)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/EclipsePluginIT.java
Mon Sep 22 20:41:24 2008
@@ -46,6 +46,17 @@
super.setUp();
}
+ /**
+ * Assumes that unit tests (ReadWorkspaceLocationsTest) have been run so
that .location files have been created
+ * correctly.
+ */
+ public void testDynamicWorkspaceLookup()
+ throws Exception
+ {
+ File basedir = new
File(TempEclipseWorkspace.getFixtureEclipseDynamicWorkspace().workspaceLocation,
"project-Z");
+ testProject( basedir );
+ }
+
public void testProject01()
throws Exception
{
@@ -459,11 +470,11 @@
public void testProject39()
throws Exception
{
- checkJRESettingsWithEclipseWorkspace( "project-39", new
TempEclipseWorkspace( "eclipseWithDefault13", true ),
+ checkJRESettingsWithEclipseWorkspace( "project-39",
TempEclipseWorkspace.getFixtureEclipseWithDefault13(),
"", null );
- checkJRESettingsWithEclipseWorkspace( "project-39", new
TempEclipseWorkspace( "eclipseWithDefault15", false ),
+ checkJRESettingsWithEclipseWorkspace( "project-39",
TempEclipseWorkspace.getFixtureEclipseWithDefault15(),
"J2SE-1.3", null );
- checkJRESettingsWithEclipseWorkspace( "project-39", new
TempEclipseWorkspace( "rad7WithDefault14", false ),
+ checkJRESettingsWithEclipseWorkspace( "project-39",
TempEclipseWorkspace.getFixtureEclipseWorkspaceWithRad7Default14(),
"J2SE-1.3", null );
}
@@ -471,18 +482,18 @@
throws Exception
{
String jre131 = new java.io.File(
"target/test-classes/eclipse/dummyJDK/1.3.1/bin/javac" ).getCanonicalPath();
- checkJRESettingsWithEclipseWorkspace( "project-40", new
TempEclipseWorkspace( "eclipseWithDefault13", true ),
+ checkJRESettingsWithEclipseWorkspace( "project-40",
TempEclipseWorkspace.getFixtureEclipseWithDefault13(),
"JVM 1.3.1", jre131 );
- checkJRESettingsWithEclipseWorkspace( "project-40", new
TempEclipseWorkspace( "eclipseWithDefault15", false ),
+ checkJRESettingsWithEclipseWorkspace( "project-40",
TempEclipseWorkspace.getFixtureEclipseWithDefault15(),
"JVM 1.3.1", jre131 );
- checkJRESettingsWithEclipseWorkspace( "project-40", new
TempEclipseWorkspace( "rad7WithDefault14", false ), "",
+ checkJRESettingsWithEclipseWorkspace( "project-40",
TempEclipseWorkspace.getFixtureEclipseWorkspaceWithRad7Default14(), "",
jre131 );
}
public void testProject41()
throws Exception
{
- TempEclipseWorkspace rad7 = new TempEclipseWorkspace(
"rad7WithDefault14", false );
+ TempEclipseWorkspace rad7 =
TempEclipseWorkspace.getFixtureEclipseWorkspaceWithRad7Default14();
Properties properties = new Properties();
properties.setProperty( "eclipse.workspace",
rad7.workspaceLocation.getCanonicalPath() );
testProject( "project-41", properties, "clean", "eclipse" );
@@ -492,7 +503,7 @@
public void testProject42()
throws Exception
{
- TempEclipseWorkspace rad7 = new TempEclipseWorkspace(
"rad7WithDefault14", false );
+ TempEclipseWorkspace rad7 =
TempEclipseWorkspace.getFixtureEclipseWorkspaceWithRad7Default14();
Properties properties = new Properties();
properties.setProperty( "eclipse.workspace",
rad7.workspaceLocation.getCanonicalPath() );
testProject( "project-42", properties, "clean", "eclipse" );
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocationsTest.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocationsTest.java?rev=698085&view=auto
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocationsTest.java
(added)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocationsTest.java
Mon Sep 22 20:41:24 2008
@@ -0,0 +1,126 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugin.eclipse.reader;
+
+import java.io.File;
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.maven.plugin.eclipse.TempEclipseWorkspace;
+
+/**
+ * @author <a href="mailto:[EMAIL PROTECTED]">Barrie Treloar</a>
+ * @version $Id: AbstractEclipsePluginIT.java 696588 2008-09-18 07:55:03Z
baerrach $
+ */
+public class ReadWorkspaceLocationsTest
+ extends TestCase
+{
+
+ private static final File PROJECTS_DIRECTORY = new File(
"target/test-classes/eclipse" );
+
+ private static final File DYNAMIC_WORKSPACE_DIRECTORY = new File(
PROJECTS_DIRECTORY, "dynamicWorkspace" );
+
+ private static final File WORKSPACE_DIRECTORY = new File(
DYNAMIC_WORKSPACE_DIRECTORY, "workspace" );
+
+ private static final File WORKSPACE_PROJECT_METADATA_DIRECTORY =
+ new File( WORKSPACE_DIRECTORY,
ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RESOURCES_PROJECTS );
+
+ /**
+ * [EMAIL PROTECTED]
+ */
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+ }
+
+ /**
+ * Project's at the workspace level do not have a .location file.
+ * <p>
+ * Therefore their project location is directly under the workspace.
+ *
+ * @throws Exception
+ */
+ public void testGetProjectLocation_ForProjectAtWorkspaceLevel()
+ throws Exception
+ {
+ ReadWorkspaceLocations objectUnderTest = new ReadWorkspaceLocations();
+
+ File metadataProjectDirectory = new File(
WORKSPACE_PROJECT_METADATA_DIRECTORY, "project-A" );
+
+ File projectLocation = objectUnderTest.getProjectLocation(
WORKSPACE_DIRECTORY, metadataProjectDirectory );
+
+ File expectedProjectDirectory = new File( WORKSPACE_DIRECTORY,
"project-A" );
+ assertFileEquals( expectedProjectDirectory, projectLocation );
+ }
+
+ /**
+ * Project's located other than at the workspace level have a .location
file.
+ * <p>
+ * This URI specifies the fully qualified path to the project. Which may
be located outside of the workspace as
+ * well.
+ *
+ * @throws Exception
+ */
+ public void testGetProjectLocation_ForProjectsWithinProjects()
+ throws Exception
+ {
+ ReadWorkspaceLocations objectUnderTest = new ReadWorkspaceLocations();
+
+ File metadataProjectDirectory = new File(
WORKSPACE_PROJECT_METADATA_DIRECTORY, "module-A1" );
+ File expectedProjectDirectory =
+ new File(
TempEclipseWorkspace.getFixtureEclipseDynamicWorkspace().workspaceLocation,
"project-A/module-A1" );
+
+ File projectLocation = objectUnderTest.getProjectLocation(
WORKSPACE_DIRECTORY, metadataProjectDirectory );
+
+ assertFileEquals( expectedProjectDirectory, projectLocation );
+ }
+
+ /**
+ * Project's located other than at the workspace level have a .location
file.
+ * <p>
+ * This URI specifies the fully qualified path to the project. Which may
be located outside of the workspace as
+ * well.
+ *
+ * @throws Exception
+ */
+ public void testGetProjectLocation_ForProjectsOutsideWorkspace()
+ throws Exception
+ {
+ ReadWorkspaceLocations objectUnderTest = new ReadWorkspaceLocations();
+
+ File metadataProjectDirectory = new File(
WORKSPACE_PROJECT_METADATA_DIRECTORY, "project-O" );
+ File expectedProjectDirectory = new File( DYNAMIC_WORKSPACE_DIRECTORY,
"project-O" );
+
+ File projectLocation = objectUnderTest.getProjectLocation(
WORKSPACE_DIRECTORY, metadataProjectDirectory );
+
+ assertFileEquals( expectedProjectDirectory, projectLocation );
+ }
+
+ /**
+ * Assert that two files represent the same absolute file.
+ *
+ * @param expectedFile
+ * @param actualFile
+ * @throws IOException
+ */
+ private void assertFileEquals( File expectedFile, File actualFile )
+ throws IOException
+ {
+ assertEquals( expectedFile.getCanonicalFile(),
actualFile.getCanonicalFile() );
+
+ }
+
+}
Propchange:
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocationsTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs?rev=698085&view=auto
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
(added)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
Mon Sep 22 20:41:24 2008
@@ -0,0 +1,3 @@
+#Thu Dec 20 11:16:55 CET 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0"
encoding\="UTF-8"?>\n<vmSettings
defaultVM\="57,org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType18,was.vm.was.base.v6">\n<vmType
id\="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType">\n<vm
id\="1197975169456" javadocURL\="http\://java.sun.com/j2se/1.5.0/docs/api/"
name\="jdk" path\="/opt/IBM2/SDP70/jdk"/>\n<vm id\="was.vm.was.express.v51"
name\="WebSphere v5.1 Express JRE"
path\="/opt/IBM2/SDP70/runtimes/base_v51_stub/java/jre"/>\n<vm
id\="was.vm.was.base.v51" name\="WebSphere v5.1 JRE"
path\="/opt/IBM2/SDP70/runtimes/base_v51_stub/java/jre"/>\n<vm
id\="was.vm.was.base.v6" name\="WebSphere v6 JRE"
path\="/opt/IBM2/SDP70/runtimes/base_v6_stub/java/jre"/>\n<vm
id\="was.vm.was.base.v61" name\="WebSphere v6.1 JRE"
path\="/opt/IBM2/SDP70/runtimes/base_v61_stub/java/jre"/>\n</vmType>\n</vmSettings>\n
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A1/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A1/pom.xml?rev=698085&view=auto
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A1/pom.xml
(added)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A1/pom.xml
Mon Sep 22 20:41:24 2008
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>eclipse</groupId>
+ <artifactId>project-A</artifactId>
+ <version>1</version>
+ </parent>
+ <groupId>eclipse</groupId>
+ <artifactId>module-A1</artifactId>
+ <version>1</version>
+ <name>Module A1</name>
+ <packaging>jar</packaging>
+ <build>
+ <!--
+ Note the lack of eclipse plugin.
+ This project is already part of the workspace being tested
+ and the eclipse plugin should not be run on it.
+ -->
+ </build>
+</project>
Propchange:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A2/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A2/pom.xml?rev=698085&view=auto
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A2/pom.xml
(added)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A2/pom.xml
Mon Sep 22 20:41:24 2008
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>eclipse</groupId>
+ <artifactId>project-A</artifactId>
+ <version>1</version>
+ </parent>
+ <groupId>eclipse</groupId>
+ <artifactId>module-A2</artifactId>
+ <version>1</version>
+ <name>Module A2</name>
+ <packaging>jar</packaging>
+ <build>
+ <!--
+ Note the lack of eclipse plugin.
+ This project is already part of the workspace being tested
+ and the eclipse plugin should not be run on it.
+ -->
+ </build>
+</project>
Propchange:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/module-A2/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/pom.xml?rev=698085&view=auto
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/pom.xml
(added)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/pom.xml
Mon Sep 22 20:41:24 2008
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>eclipse</groupId>
+ <artifactId>project-A</artifactId>
+ <version>1</version>
+ <name>Project A</name>
+ <packaging>pom</packaging>
+ <build>
+ <!--
+ Note the lack of eclipse plugin.
+ This project is already part of the workspace being tested
+ and the eclipse plugin should not be run on it.
+ -->
+ </build>
+ <modules>
+ <module>module-A1</module>
+ <module>module-A2</module>
+ </modules>
+</project>
Propchange:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-A/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.classpath
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.classpath?rev=698085&view=auto
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.classpath
(added)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.classpath
Mon Sep 22 20:41:24 2008
@@ -0,0 +1,8 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="/module-A1"/>
+ <classpathentry kind="var"
path="M2_REPO/eclipse/module-A2/1/module-A2-1.jar"/>
+ <classpathentry kind="src" path="/project-O"/>
+</classpath>
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.classpath
------------------------------------------------------------------------------
svn:eol-style = native
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.project
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.project?rev=698085&view=auto
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.project
(added)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.project
Mon Sep 22 20:41:24 2008
@@ -0,0 +1,16 @@
+<projectDescription>
+ <name>project-Z</name>
+ <comment/>
+ <projects>
+ <project>module-A1</project>
+ <project>project-O</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/expected/.project
------------------------------------------------------------------------------
svn:eol-style = native
Added:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/pom.xml?rev=698085&view=auto
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/pom.xml
(added)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/pom.xml
Mon Sep 22 20:41:24 2008
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>eclipse</groupId>
+ <artifactId>project-Z</artifactId>
+ <version>1</version>
+ <name>Project Z</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>test</version>
+ <!--
+ Note the lack of configuration.
+ This project test's that the workspace can be located dynamically.
+ -->
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>eclipse</groupId>
+ <artifactId>module-A1</artifactId>
+ <version>1</version>
+ </dependency>
+ <dependency>
+ <groupId>eclipse</groupId>
+ <artifactId>module-A2</artifactId>
+ <version>1</version>
+ </dependency>
+ <dependency>
+ <groupId>eclipse</groupId>
+ <artifactId>project-O</artifactId>
+ <version>1</version>
+ </dependency>
+ </dependencies>
+</project>
Propchange:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/eclipse/dynamicWorkspace/workspace/project-Z/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-36/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-36/pom.xml?rev=698085&r1=698084&r2=698085&view=diff
==============================================================================
---
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-36/pom.xml
(original)
+++
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-36/pom.xml
Mon Sep 22 20:41:24 2008
@@ -14,6 +14,7 @@
<version>test</version>
<configuration>
<wtpversion>2.0</wtpversion>
+ <workspace>${basedir}</workspace>
</configuration>
</plugin>
<plugin>