You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2002/12/07 03:19:09 UTC
cvs commit: jakarta-turbine-maven/src/test/java/org/apache/maven/project BuildTest.java ProjectResourcesTest.java
jvanzyl 2002/12/06 18:19:09
Modified: . maven.xml project.properties project.xml
src/conf driver.jelly
src/java/org/apache/maven AbstractMavenComponent.java
DependencyClasspathBuilder.java
src/java/org/apache/maven/jelly MavenJellyContext.java
src/java/org/apache/maven/plugin PluginManager.java
src/java/org/apache/maven/project Build.java Resource.java
src/plugins-build/java plugin.jelly
src/plugins-build/tasklist project.xml
src/plugins-build/test plugin.jelly
src/test/java/org/apache/maven/project BuildTest.java
Added: src/bin maven.classworlds
Removed: src/test/java/org/apache/maven/project
ProjectResourcesTest.java
Log:
o Aligned the resources usage across the board.
maven.jarResources.basedir
is no long required or consulted when dealing with resources, everything
is taken from the POM.
Take a look at maven's project.xml for an example.
With each <resource/> element there is also an optional <targetPath/>
element that will allow you to translate resources within the target
directory if you wish. It is used in the maven build to move
src/messages/messages.*
to
${maven.build.test}/org/apache/maven/messages
Revision Changes Path
1.64 +0 -13 jakarta-turbine-maven/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/maven.xml,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- maven.xml 6 Dec 2002 16:32:25 -0000 1.63
+++ maven.xml 7 Dec 2002 02:19:08 -0000 1.64
@@ -382,21 +382,8 @@
</postGoal>
-->
- <!--
- <preGoal name="java:jar">
- <echo>!!!! ${pom.getDependencyPath('forehead')}</echo>
- <copy todir="${maven.build.dest}" file="${pom.getDependencyPath('forehead')}"/>
- </preGoal>
- -->
-
<preGoal name="site:generate">
<attainGoal name="clover"/>
- </preGoal>
-
- <preGoal name="java:jar">
- <copy todir="${maven.build.dest}/org/apache/maven/messages">
- <fileset dir="${maven.src.dir}/messages"/>
- </copy>
</preGoal>
</project>
1.34 +0 -2 jakarta-turbine-maven/project.properties
Index: project.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/project.properties,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- project.properties 25 Nov 2002 18:30:24 -0000 1.33
+++ project.properties 7 Dec 2002 02:19:08 -0000 1.34
@@ -3,8 +3,6 @@
# -------------------------------------------------------------------
maven.final.name = maven
-maven.jarResources.basedir = src/conf
-
maven.announcement = beta2
# -------------------------------------------------------------------
1.222 +29 -19 jakarta-turbine-maven/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/project.xml,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -r1.221 -r1.222
--- project.xml 6 Dec 2002 20:53:28 -0000 1.221
+++ project.xml 7 Dec 2002 02:19:08 -0000 1.222
@@ -13,7 +13,7 @@
<inceptionYear>2001</inceptionYear>
<package>org.apache.maven</package>
<logo>/images/maven.jpg</logo>
-
+
<!-- Gump integration -->
<gumpRepositoryId>jakarta</gumpRepositoryId>
@@ -307,7 +307,7 @@
<name>Nathan Coast</name>
<email>nathan.coast@blueyonder.co.uk</email>
</contributor>
-
+
<contributor>
<name>Martin Cooper</name>
<email>martin.cooper@tumbleweed.com</email>
@@ -332,7 +332,7 @@
<name>Michael McCallum</name>
<email>gholam@apache.org</email>
</contributor>
-
+
<contributor>
<name>Markus M. May</name>
<email>mmay@javafreedom.org</email>
@@ -342,7 +342,7 @@
<name>Tom Palmer</name>
<email>tomp@uk.uu.net</email>
</contributor>
-
+
<contributor>
<name>Kuisong Tong</name>
<email>Kuisong.Tong@vtradex.com</email>
@@ -365,13 +365,13 @@
<dependency>
<id>ant</id>
- <version>1.5.1</version>
+ <version>1.5</version>
<url>http://jakarta.apache.org/ant/</url>
</dependency>
<dependency>
<id>ant+optional</id>
- <version>1.5.1</version>
+ <version>1.5</version>
<url>http://jakarta.apache.org/ant/</url>
</dependency>
@@ -472,7 +472,7 @@
<version>1.0-beta-4</version>
<url>http://forehead.sf.net/</url>
</dependency>
-
+
<dependency>
<id>logkit</id>
<version>1.0.1</version>
@@ -512,14 +512,14 @@
<url>http://xml.apache.org/xerces2-j/</url>
</dependency>
- <!--
-
+ <!--
+
This is required for the DVSL formatter so this needs to be fixed.
The reporting tool should be split apart and a little tool for
the jdepend report needs to go into the jdepend plugin.
-
+
-->
-
+
<dependency>
<id>jdepend</id>
<version>2.2</version>
@@ -544,14 +544,24 @@
</unitTest>
<resources>
- <includes>
- <include>*.xsd</include>
- <include>*.dtd</include>
- <include>*.mod</include>
- <include>log4j.properties</include>
- <include>driver.jelly</include>
- <include>driver.properties</include>
- </includes>
+ <resource>
+ <directory>src/conf</directory>
+ <includes>
+ <include>*.xsd</include>
+ <include>*.dtd</include>
+ <include>*.mod</include>
+ <include>log4j.properties</include>
+ <include>driver.jelly</include>
+ <include>driver.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/messages</directory>
+ <targetPath>org/apache/maven/messages</targetPath>
+ <includes>
+ <include>messages.*</include>
+ </includes>
+ </resource>
</resources>
</build>
1.1 jakarta-turbine-maven/src/bin/maven.classworlds
Index: maven.classworlds
===================================================================
#! /bin/sh
# Copyright (c) 2001-2002 The Apache Software Foundation. All rights
# reserved.
CLASSWORLDS_VERSION=1.0-beta-2
MAVEN_OPTS="-Xmx128m"
if [ -f "$HOME/.mavenrc" ] ; then
. $HOME/.mavenrc
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
Darwin*) darwin=true ;;
esac
if [ -z "$MAVEN_HOME" ] ; then
# try to find MAVEN
if [ -d /opt/maven ] ; then
MAVEN_HOME=/opt/maven
fi
if [ -d ${HOME}/maven ] ; then
MAVEN_HOME=${HOME}/maven
fi
## resolve links - $0 may be a link to maven's home
PRG=$0
progname=`basename $0`
saveddir=`pwd`
# need this for relative symlinks
cd `dirname $PRG`
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname $PRG`/$link"
fi
done
MAVEN_HOME=`dirname "$PRG"`/..
# make it fully qualified
MAVEN_HOME=`cd "$MAVEN_HOME" && pwd`
cd $saveddir
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$MAVEN_HOME" ] &&
MAVEN_HOME=`cygpath --unix "$MAVEN_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
else
JAVACMD=java
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute $JAVACMD"
exit
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
echo " If build fails because sun.* classes could not be found"
echo " you will need to set the JAVA_HOME environment variable"
echo " to the installation directory of java."
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
MAVEN_HOME=`cygpath --path --windows "$MAVEN_HOME"`
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
fi
# For Darwin, use classes.jar for TOOLS_JAR
TOOLS_JAR="${JAVA_HOME}/lib/tools.jar"
if $darwin; then
TOOLS_JAR="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes/classes.jar"
fi
MAIN_CLASS=com.werken.classworlds.Launcher
$JAVACMD \
$MAVEN_OPTS \
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \
"-Djava.endorsed.dirs=${JAVA_HOME}/lib/endorsed:${MAVEN_HOME}/lib/endorsed" \
-classpath "${MAVEN_HOME}/lib/classworlds-${CLASSWORLDS_VERSION}.jar" \
"-Dclassworlds.conf.file=${MAVEN_HOME}/bin/classworlds.conf" \
"-Dtools.jar=$TOOLS_JAR" \
"-Dmaven.home=${MAVEN_HOME}" \
$MAIN_CLASS $@
1.3 +76 -39 jakarta-turbine-maven/src/conf/driver.jelly
Index: driver.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/conf/driver.jelly,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- driver.jelly 24 Nov 2002 18:05:39 -0000 1.2
+++ driver.jelly 7 Dec 2002 02:19:08 -0000 1.3
@@ -3,8 +3,9 @@
<project
xmlns:j="jelly:core"
xmlns:define="jelly:define"
+ xmlns:resources="resources"
xmlns:m="maven">
-
+
<!-- ================================================================== -->
<!-- M A V E N T A G L I B R A R Y -->
<!-- ================================================================== -->
@@ -13,7 +14,7 @@
<!-- ================================================================== -->
<define:taglib uri="maven">
-
+
<!-- ================================================================== -->
<!-- U S E R N A M E C H E C K -->
<!-- ================================================================== -->
@@ -21,7 +22,7 @@
<!-- hold of a valid username. For deployment goals in particular -->
<!-- where Maven needs to upload an artifact to a server. -->
<!-- ================================================================== -->
-
+
<define:tag name="user-check">
<j:set var="tmp" value="${user}"/>
<j:if test="${tmp.equals('USERNAME_NOT_SET')}">
@@ -38,45 +39,81 @@
</fail>
</j:if>
</define:tag>
-
</define:taglib>
- <!-- Allow a hook for processing around the build start. -->
+ <define:taglib uri="resources">
+ <!--
+ | Copy all the file matched by each provided Resource to
+ | the provided destination directory.
+ |
+ | @param resources A collection of pom Resource objects
+ | @param todir Target directory
+ | @param targetPath
+ |
+ -->
+
+ <define:tag name="copy">
+ <j:forEach var="resource" items="${resources}">
+ <j:choose>
+ <j:when test="${resource.targetPath ==''}">
+ <j:set var="targetDirectory" value="${todir}"/>
+ </j:when>
+ <j:otherwise>
+ <j:set var="targetDirectory" value="${todir}/${resource.targetPath}"/>
+ </j:otherwise>
+ </j:choose>
+ <copy todir="${targetDirectory}">
+ <fileset dir="${resource.directory}">
+ <j:forEach var="include" items="${resource.includes}">
+ <include name="${include}"/>
+ </j:forEach>
+ <j:forEach var="exclude" items="${resource.excludes}">
+ <exclude name="${exclude}"/>
+ </j:forEach>
+ </fileset>
+ </copy>
+ </j:forEach>
+ </define:tag>
+ </define:taglib>
- <goal name="build:start"/>
-
- <!-- ================================================================== -->
- <!-- D R I V E R I N I T I A L I Z A T I O N -->
- <!-- ================================================================== -->
- <!-- All things we want to provide to all plugins, or processes we -->
- <!-- performed before every build are declared/defined here. -->
- <!-- ================================================================== -->
+ <!-- Allow a hook for processing around the build start. -->
+
+ <goal name="build:start"/>
+
+ <!-- ================================================================== -->
+ <!-- D R I V E R I N I T I A L I Z A T I O N -->
+ <!-- ================================================================== -->
+ <!-- All things we want to provide to all plugins, or processes we -->
+ <!-- performed before every build are declared/defined here. -->
+ <!-- ================================================================== -->
+
+ <j:set var="dir__" value="${pom.build.sourceDirectory}X"/>
+ <j:if test="${dir__ != 'X'}">
+ <available
+ property="sourcesPresent"
+ file="${pom.build.sourceDirectory}"
+ />
+ </j:if>
+
+ <j:set var="dir__" value="${pom.build.unitTestSourceDirectory}X"/>
+ <j:if test="${dir__ != 'X'}">
+ <available
+ property="unitTestSourcesPresent"
+ file="${pom.build.unitTestSourceDirectory}"
+ />
+ </j:if>
+
+ <path id="maven-classpath">
+ <fileset dir="${maven.home}/lib"/>
+ </path>
+
+ <j:if test="${sourcesPresent == 'true'}">
+ <path id="maven.compile.src.set">
+ <pathelement location="${pom.build.SourceDirectory}"/>
+ </path>
+ </j:if>
+
+ <goal name="build:end"/>
- <j:set var="dir__" value="${pom.build.sourceDirectory}X"/>
- <j:if test="${dir__ != 'X'}">
- <available
- property="sourcesPresent"
- file="${pom.build.sourceDirectory}"
- />
- </j:if>
-
- <j:set var="dir__" value="${pom.build.unitTestSourceDirectory}X"/>
- <j:if test="${dir__ != 'X'}">
- <available
- property="unitTestSourcesPresent"
- file="${pom.build.unitTestSourceDirectory}"
- />
- </j:if>
-
- <path id="maven-classpath">
- <fileset dir="${maven.home}/lib"/>
- </path>
-
- <j:if test="${sourcesPresent == 'true'}">
- <path id="maven.compile.src.set">
- <pathelement location="${pom.build.SourceDirectory}"/>
- </path>
- </j:if>
-
</project>
1.4 +25 -1 jakarta-turbine-maven/src/java/org/apache/maven/AbstractMavenComponent.java
Index: AbstractMavenComponent.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/AbstractMavenComponent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractMavenComponent.java 4 Dec 2002 07:01:15 -0000 1.3
+++ AbstractMavenComponent.java 7 Dec 2002 02:19:08 -0000 1.4
@@ -57,6 +57,7 @@
*/
import org.apache.maven.jelly.MavenJellyContext;
+import org.apache.maven.project.Project;
/**
* Base class from which all components in maven are derived.
@@ -74,6 +75,9 @@
/** Jelly conext. */
private MavenJellyContext context;
+ /** Project. */
+ private Project project;
+
// ------------------------------------------------------------
// C O N S T R U C T O R S
// ------------------------------------------------------------
@@ -104,6 +108,26 @@
public MavenJellyContext getContext()
{
return context;
+ }
+
+ /**
+ * Set maven project explicity.
+ *
+ * @param project Maven project.
+ */
+ public void setProject( Project project )
+ {
+ this.project = project;
+ }
+
+ /**
+ * Get explicity set maven project.
+ *
+ * @return Explicitly set Maven project.
+ */
+ public Project getProject()
+ {
+ return project;
}
/** @see MavenUtils#getMessage */
1.3 +1 -13 jakarta-turbine-maven/src/java/org/apache/maven/DependencyClasspathBuilder.java
Index: DependencyClasspathBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/DependencyClasspathBuilder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DependencyClasspathBuilder.java 6 Dec 2002 16:32:25 -0000 1.2
+++ DependencyClasspathBuilder.java 7 Dec 2002 02:19:08 -0000 1.3
@@ -92,8 +92,6 @@
/** Reference id for the generated classpath. */
private String refid;
- private Project project;
-
// --------------------------------------------------------------
// A C C E S S O R S
// --------------------------------------------------------------
@@ -116,16 +114,6 @@
public String getRefid()
{
return refid;
- }
-
- public void setProject( Project project )
- {
- this.project = project;
- }
-
- public Project getProject()
- {
- return project;
}
// --------------------------------------------------------------
1.19 +6 -7 jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenJellyContext.java
Index: MavenJellyContext.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenJellyContext.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- MavenJellyContext.java 6 Dec 2002 16:32:25 -0000 1.18
+++ MavenJellyContext.java 7 Dec 2002 02:19:08 -0000 1.19
@@ -182,10 +182,10 @@
*/
public void registerTagLibrary( String namespaceURI, TagLibrary taglib )
{
- if ( !isTagLibraryRegistered( namespaceURI ) )
+ if ( isTagLibraryRegistered( namespaceURI ) == false )
{
super.registerTagLibrary( namespaceURI, taglib );
- this.tagLibUris.add( namespaceURI );
+ tagLibUris.add( namespaceURI );
}
}
@@ -204,10 +204,10 @@
public void registerTagLibrary( String namespaceURI,
String className )
{
- if ( !isTagLibraryRegistered( namespaceURI ) )
+ if ( isTagLibraryRegistered( namespaceURI ) == false )
{
super.registerTagLibrary( namespaceURI, className );
- this.tagLibUris.add( namespaceURI );
+ tagLibUris.add( namespaceURI );
}
}
@@ -241,7 +241,7 @@
*/
public void addLazyTagLibraries( Set uris )
{
- this.lazyTagLibs.addAll( uris );
+ lazyTagLibs.addAll( uris );
}
/** Get all taglib URIs.
@@ -367,7 +367,6 @@
{
return (String) getVariable( MavenConstants.REPO_LOCAL );
}
-
/**
* Set the project verifier.
1.13 +6 -4 jakarta-turbine-maven/src/java/org/apache/maven/plugin/PluginManager.java
Index: PluginManager.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/plugin/PluginManager.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- PluginManager.java 6 Dec 2002 16:32:25 -0000 1.12
+++ PluginManager.java 7 Dec 2002 02:19:08 -0000 1.13
@@ -63,6 +63,7 @@
import org.apache.maven.AbstractMavenComponent;
import org.apache.maven.DependencyClasspathBuilder;
import org.apache.maven.MavenUtils;
+import org.apache.maven.verifier.DependencyVerifier;
import org.apache.maven.jelly.JellyUtils;
import org.apache.maven.jelly.MavenJellyContext;
import org.apache.maven.project.Dependency;
@@ -889,7 +890,6 @@
Map pluginProperties = pluginProject.resolvedProperties();
MavenUtils.integrateMapInContext( pluginProperties, pluginContext );
-
pluginContext.setVariable( "plugin", pluginProject );
pluginContext.setVariable( "plugin.dir", getPluginDir( name ) );
pluginContext.addLazyTagLibraries( taglibsCache.keySet() );
@@ -908,8 +908,10 @@
if ( isPluginProcessed( name ) == false )
{
// Retrieve the dependencies that this plugin requires.
- //getContext().getProjectVerifier().setMavenProject( pluginProject );
- getContext().getProjectVerifier().execute();
+ //getContext().getProjectVerifier().execute();
+ DependencyVerifier dependencyVerifier = new DependencyVerifier();
+ dependencyVerifier.setContext( getContext() );
+ dependencyVerifier.setProject( pluginProject );
// Mark the plugin as processed.
createNewFile( getPluginProcessedMarker( name ) );
1.18 +15 -163 jakarta-turbine-maven/src/java/org/apache/maven/project/Build.java
Index: Build.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/project/Build.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Build.java 25 Nov 2002 18:20:35 -0000 1.17
+++ Build.java 7 Dec 2002 02:19:08 -0000 1.18
@@ -67,25 +67,6 @@
extends BaseObject
{
/**
- * Pattern set entries used to control which
- * resources in the project's module should be placed in
- * the distribution JAR.
- */
- private List jarResources;
-
- /**
- * Pattern set entries used to control which classes
- * participate in unit testing.
- */
- private List unitTestPatterns;
-
- /**
- * Pattern set entries used to control which classes
- * participate in integration unit testing.
- */
- private List integrationUnitTestPatterns;
-
- /**
* Path entries that control which source directories are used
* to compile the project.
*/
@@ -98,11 +79,6 @@
private String aspectSourceDirectory;
/**
- * JAR files that are produced by this project.
- */
- private List jars;
-
- /**
* The directory on where the unit test source files are stored.
*/
private String unitTestSourceDirectory;
@@ -122,26 +98,17 @@
/** Unit test specification patterns. */
private UnitTest unitTest;
- /** Jar resources. */
- private Resources resources;
-
- /** Test resources. */
- private List testResources;
-
/** Source exclusions */
private List sourceModifications;
+ private List resources;
/**
* Constructor for the Build object
*/
public Build()
{
- jarResources = new ArrayList();
- unitTestPatterns = new ArrayList();
- integrationUnitTestPatterns = new ArrayList();
sourceModifications = new ArrayList();
- jars = new ArrayList();
- testResources = new ArrayList();
+ resources = new ArrayList();
}
/**
@@ -186,29 +153,6 @@
}
/**
- * Adds a feature to the JarResource attribute of the Build object
- *
- * @param jarResource an includes/excludes pattern to be added to the list,
- * e.g. includes=*.properties
- * @see #getJarResources()
- */
- public void addJarResource( String jarResource )
- {
- jarResources.add( jarResource );
- }
-
- /**
- * Gets the jarResources attribute of the Build object
- *
- * @return the list of patterns describing for resources to be placed
- * in the jar file resulting from a build
- */
- public List getJarResources()
- {
- return jarResources;
- }
-
- /**
* Add source modification.
*
* @param sourceModification Add a single source modification.
@@ -239,52 +183,6 @@
}
/**
- * Adds a feature to the unitTestPattern attribute of the Build object
- *
- * @param unitTestPattern a single pattern to be added to the list, e.g.
- * **\Test*.java
- */
- public void addUnitTestPattern( String unitTestPattern )
- {
- unitTestPatterns.add( unitTestPattern );
- }
-
- /**
- * Gets the unitTestPatterns attribute of the Build object
- *
- * @return the list of patterns that select unit tests from the test
- * source code
- */
- public List getUnitTestPatterns()
- {
- return unitTestPatterns;
- }
-
- /**
- * Adds a feature to the integrationUnitTestClassEntry attribute of the
- * Build object.
- *
- * @param integrationUnitTestPattern the pattern to add to the list of
- * patters
- * @see #getIntegrationUnitTestPatterns()
- */
- public void addIntegrationUnitTestPattern( String integrationUnitTestPattern )
- {
- integrationUnitTestPatterns.add( integrationUnitTestPattern );
- }
-
- /**
- * Gets the integrationUnitTestClassEntries attribute of the Build object.
- *
- * @return the patterns that select integration unit tests from the test
- * source code
- */
- public List getIntegrationUnitTestPatterns()
- {
- return integrationUnitTestPatterns;
- }
-
- /**
* Adds a feature to the SourceDirectory attribute of the Build object
*
* @param sourceDirectory the directory for java source code
@@ -325,27 +223,6 @@
}
/**
- * Adds a feature to the Jar attribute of the Build object
- *
- * @param jar a jar file name
- */
- public void addJar( String jar )
- {
- jars.add( jar );
- }
-
- /**
- * Gets the jars attribute of the Build object
- *
- * @return a list of {@link String strings} each representing a jar file
- * @see #addJar(String)
- */
- public List getJars()
- {
- return jars;
- }
-
- /**
* Set the nag email address, which is used for automated build failures.
*
* @param nagEmailAddress the new value of the nag email address
@@ -386,57 +263,32 @@
}
/**
- * Set the resources to be package into the resultant JAR.
+ * Add a test resource.
*
- * @param resources JAR resources.
+ * @param resource Add a test resource.
*/
- public void setResources( Resources resources )
+ public void addResource( Resource resource )
{
- this.resources = resources;
+ resources.add( resource );
}
/**
- * Get the resources to be packaged into the resultant JAR.
+ * Set the resources.
*
- * @return JAR resources.
+ * @param resources Test resources.
*/
- public Resources getResources()
+ public void setResources( List resources )
{
- if ( this.resources == null )
- {
- this.resources = new Resources();
- }
-
- return this.resources;
- }
-
- /**
- * Add a test resource to this project.
- *
- * @param testResource TestResource for this project.
- */
- public void addTestResource( TestResource testResource )
- {
- testResources.add( testResource );
- }
-
- /**
- * Sets the test resources for this project.
- *
- * @param testResources the list of test resources.
- */
- public void setTestResources( List testResources )
- {
- this.testResources = testResources;
+ this.resources = resources;
}
/**
- * Return the test resources for this project.
+ * Gets the resources.
*
- * @return List of test resources.
+ * @return Resources patterns for including or excluding arbitrary resources.
*/
- public List getTestResources()
+ public List getResources()
{
- return this.testResources;
+ return resources;
}
}
1.5 +23 -0 jakarta-turbine-maven/src/java/org/apache/maven/project/Resource.java
Index: Resource.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/project/Resource.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Resource.java 25 Nov 2002 19:05:23 -0000 1.4
+++ Resource.java 7 Dec 2002 02:19:08 -0000 1.5
@@ -69,6 +69,9 @@
/** Resource Directory */
private String dir;
+ /** Target directory. */
+ private String targetPath = "";
+
/** Include patterns. */
private List includes = new ArrayList();
@@ -133,5 +136,25 @@
public String getDirectory()
{
return this.dir;
+ }
+
+ /**
+ * Set the target directory where resources are placed.
+ *
+ * @param targetPath The directory where resources are placed.
+ */
+ public void setTargetPath( String targetPath )
+ {
+ this.targetPath = targetPath;
+ }
+
+ /**
+ * Get the directory where resources are placed
+ *
+ * @return The directory where resources are placed.
+ */
+ public String getTargetPath()
+ {
+ return targetPath;
}
}
1.34 +7 -15 jakarta-turbine-maven/src/plugins-build/java/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/java/plugin.jelly,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- plugin.jelly 6 Dec 2002 16:32:25 -0000 1.33
+++ plugin.jelly 7 Dec 2002 02:19:08 -0000 1.34
@@ -4,6 +4,7 @@
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
xmlns:deploy="deploy"
+ xmlns:resources="resources"
xmlns:m="maven">
<j:choose>
@@ -110,21 +111,12 @@
<goal name="java:jar-resources"
description="Copy any resources that must be present in the deployed JAR file">
-
- <j:if test="${maven.has.jar.resource.patterns}">
-
- <!-- Copy any resources that must be present in the deployed
- JAR file.
- -->
-
- <echo>Copying resources from ${maven.jarResources.basedir}</echo>
-
- <copy todir="${maven.build.dest}">
- <fileset dir="${maven.jarResources.basedir}">
- <patternset refid="maven.jar.resources.set"/>
- </fileset>
- </copy>
-
+
+ <j:if test="${!pom.build.resources.isEmpty()}">
+ <resources:copy
+ resources="${pom.build.resources}"
+ todir="${maven.build.dest}"
+ />
</j:if>
</goal>
1.17 +1 -2 jakarta-turbine-maven/src/plugins-build/tasklist/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/tasklist/project.xml,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- project.xml 26 Nov 2002 06:51:00 -0000 1.16
+++ project.xml 7 Dec 2002 02:19:08 -0000 1.17
@@ -97,7 +97,6 @@
<sourceDirectory>src/java</sourceDirectory>
<unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>
- <!-- Unit test classes -->
<unitTest>
<includes>
<include>**/*Test.java</include>
@@ -106,7 +105,7 @@
<resources>
<resource>
- <directory>${maven.src.dir}/templates</directory>
+ <directory>templates</directory>
<includes>
<include>*.vm</include>
</includes>
1.24 +5 -38 jakarta-turbine-maven/src/plugins-build/test/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/test/plugin.jelly,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- plugin.jelly 6 Dec 2002 16:32:26 -0000 1.23
+++ plugin.jelly 7 Dec 2002 02:19:08 -0000 1.24
@@ -2,6 +2,7 @@
<project xmlns:j="jelly:core"
xmlns:u="jelly:util"
+ xmlns:resources="resources"
xmlns:define="jelly:define">
<goal name="test"
@@ -266,37 +267,6 @@
xmlns:resources="resources">
<j:if test="${unitTestSourcesPresent == 'true'}">
-
- <define:taglib uri="resources">
- <!--
- - Copy all the file matched by each provided Resource to
- - the provided destination directory.
- -
- - @param resources A collection of pom Resource objects
- - @param todir Target directory
- -->
- <define:tag name="copy">
- <copy todir="${todir}">
- <j:forEach var="res" items="${resources}">
- <fileset dir="${res.directory}">
- <j:forEach var="inc" items="${res.includes}">
- <include name="${inc}"/>
- </j:forEach>
- <j:forEach var="exc" items="${res.excludes}">
- <exclude name="${exc}"/>
- </j:forEach>
- </fileset>
- </j:forEach>
- </copy>
- </define:tag>
- </define:taglib>
-
- <!--
- - build.unitTest.resources
- -->
-
- <echo> test dest ${maven.test.dest} </echo>
-
<j:if test="${!pom.build.unitTest.resources.isEmpty()}">
<!--
@@ -307,14 +277,11 @@
-->
<j:if test="${pom.build.unitTest.resources == ''}">
-
- <resources:copy
- resources="${pom.build.unitTest.resources}"
- todir="${maven.test.dest}"
- />
-
+ <resources:copy
+ resources="${pom.build.unitTest.resources}"
+ todir="${maven.test.dest}"
+ />
</j:if>
-
</j:if>
</j:if>
</goal>
1.2 +0 -63 jakarta-turbine-maven/src/test/java/org/apache/maven/project/BuildTest.java
Index: BuildTest.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/test/java/org/apache/maven/project/BuildTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BuildTest.java 26 Nov 2002 23:39:25 -0000 1.1
+++ BuildTest.java 7 Dec 2002 02:19:08 -0000 1.2
@@ -108,30 +108,6 @@
// JUnitDoclet end method getSourceModifications
}
- public void testAddUnitTestPattern() throws Exception
- {
- // JUnitDoclet begin method addUnitTestPattern
- // JUnitDoclet end method addUnitTestPattern
- }
-
- public void testGetUnitTestPatterns() throws Exception
- {
- // JUnitDoclet begin method getUnitTestPatterns
- // JUnitDoclet end method getUnitTestPatterns
- }
-
- public void testAddIntegrationUnitTestPattern() throws Exception
- {
- // JUnitDoclet begin method addIntegrationUnitTestPattern
- // JUnitDoclet end method addIntegrationUnitTestPattern
- }
-
- public void testGetIntegrationUnitTestPatterns() throws Exception
- {
- // JUnitDoclet begin method getIntegrationUnitTestPatterns
- // JUnitDoclet end method getIntegrationUnitTestPatterns
- }
-
public void testSetGetSourceDirectory() throws Exception
{
// JUnitDoclet begin method setSourceDirectory getSourceDirectory
@@ -158,18 +134,6 @@
// JUnitDoclet end method setAspectSourceDirectory getAspectSourceDirectory
}
- public void testAddJar() throws Exception
- {
- // JUnitDoclet begin method addJar
- // JUnitDoclet end method addJar
- }
-
- public void testGetJars() throws Exception
- {
- // JUnitDoclet begin method getJars
- // JUnitDoclet end method getJars
- }
-
public void testSetGetNagEmailAddress() throws Exception
{
// JUnitDoclet begin method setNagEmailAddress getNagEmailAddress
@@ -196,38 +160,11 @@
// JUnitDoclet end method setUnitTest getUnitTest
}
- public void testSetGetResources() throws Exception
- {
- // JUnitDoclet begin method setResources getResources
- org.apache.maven.project.Resources[] tests = {new org.apache.maven.project.Resources()};
-
- for ( int i = 0; i < tests.length; i++ )
- {
- build.setResources( tests[i] );
- assertEquals( tests[i], build.getResources() );
- }
- // JUnitDoclet end method setResources getResources
- }
-
public void testAddTestResource() throws Exception
{
// JUnitDoclet begin method addTestResource
// JUnitDoclet end method addTestResource
}
-
- public void testSetGetTestResources() throws Exception
- {
- // JUnitDoclet begin method setTestResources getTestResources
- java.util.List[] tests = {new java.util.ArrayList(), null};
-
- for ( int i = 0; i < tests.length; i++ )
- {
- build.setTestResources( tests[i] );
- assertEquals( tests[i], build.getTestResources() );
- }
- // JUnitDoclet end method setTestResources getTestResources
- }
-
/**
* JUnitDoclet moves marker to this method, if there is not match