jvanzyl 2004/03/12 09:52:34
Modified: maven-project/src/java/org/apache/maven/project
MavenProject.java
Log:
o strip out the ${basedir} token so we can treat everything here the same and
not rely on interpolation.
Revision Changes Path
1.12 +26 -23
maven-components/maven-project/src/java/org/apache/maven/project/MavenProject.java
Index: MavenProject.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-project/src/java/org/apache/maven/project/MavenProject.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- MavenProject.java 10 Mar 2004 21:37:37 -0000 1.11
+++ MavenProject.java 12 Mar 2004 17:52:34 -0000 1.12
@@ -192,12 +192,6 @@
}
}
- /**
- * Set an individual dependency's classpath entry.
- *
- * @param depId Dependency id.
- * @param path Classpath for the given dependency.
- */
public void setDependencyPath( String depId, String path )
{
dependencyPaths.put( depId, path );
@@ -208,19 +202,11 @@
return (String) dependencyPaths.get( artifactId );
}
- /**
- *
- * @param denpendencies
- */
public void setDependencies( List denpendencies )
{
getModel().setDependencies( denpendencies );
}
- /**
- *
- * @return
- */
public List getDependencies()
{
return getModel().getDependencies();
@@ -342,7 +328,7 @@
String[] classpathElements = new String[size + 1];
- classpathElements[0] = getProperty("maven.build.dest");
+ classpathElements[0] = getProperty( "maven.build.dest" );
for ( int i = 0; i < size; i++ )
{
@@ -352,7 +338,7 @@
if ( isAddedToClasspath( d ) )
{
- classpathElements[i+1] = artifact.getPath();
+ classpathElements[i + 1] = artifact.getPath();
}
}
@@ -827,21 +813,21 @@
if ( build != null )
{
- String s = build.getSourceDirectory();
+ String s = stripBasedirToken( build.getSourceDirectory() );
if ( requiresBaseDirectoryAlignment( s ) )
{
build.setSourceDirectory( new File( getFile().getParentFile(), s
).getPath() );
}
- s = build.getUnitTestSourceDirectory();
+ s = stripBasedirToken( build.getUnitTestSourceDirectory() );
if ( requiresBaseDirectoryAlignment( s ) )
{
build.setUnitTestSourceDirectory( new File(
getFile().getParentFile(), s ).getPath() );
}
- s = build.getAspectSourceDirectory();
+ s = stripBasedirToken( build.getAspectSourceDirectory() );
if ( requiresBaseDirectoryAlignment( s ) )
{
@@ -854,7 +840,7 @@
{
Resource resource = (Resource) i.next();
- s = resource.getDirectory();
+ s = stripBasedirToken( resource.getDirectory() );
if ( requiresBaseDirectoryAlignment( s ) )
{
@@ -868,7 +854,7 @@
{
Resource resource = (Resource) i.next();
- s = resource.getDirectory();
+ s = stripBasedirToken( resource.getDirectory() );
if ( requiresBaseDirectoryAlignment( s ) )
{
@@ -878,11 +864,28 @@
}
}
+ private String stripBasedirToken( String s )
+ {
+ if ( s != null )
+ {
+ s = s.trim();
+
+ if ( s.startsWith( "${basedir}" ) )
+ {
+ // Take out ${basedir} and the leading slash
+ s = s.substring( 11 );
+ }
+ }
+
+ return s;
+ }
+
private boolean requiresBaseDirectoryAlignment( String s )
{
if ( s != null )
{
- File f = new File(s);
+ File f = new File( s );
+
if ( s.startsWith( FILE_SEPARATOR ) || f.isAbsolute() )
{
return false;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]