Author: brett
Date: Thu Jan 5 20:07:11 2006
New Revision: 366416
URL: http://svn.apache.org/viewcvs?rev=366416&view=rev
Log:
[MJAR-16] ability to change output directory of jar, and source directory for
classes
Modified:
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java
Modified:
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
URL:
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java?rev=366416&r1=366415&r2=366416&view=diff
==============================================================================
---
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
(original)
+++
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
Thu Jan 5 20:07:11 2006
@@ -45,9 +45,8 @@
*
* @parameter expression="${project.build.directory}"
* @required
- * @readonly
*/
- private File basedir;
+ private File outputDirectory;
/**
* Name of the generated JAR.
@@ -89,18 +88,13 @@
/**
* Return the specific output directory to serve as the root for the
archive.
*/
- protected abstract File getOutputDirectory();
+ protected abstract File getClassesDirectory();
protected final MavenProject getProject()
{
return project;
}
- protected final File getBaseDir()
- {
- return basedir;
- }
-
/**
* Overload this to produce a test-jar, for example.
*/
@@ -128,7 +122,7 @@
public File createArchive()
throws MojoExecutionException
{
- File jarFile = getJarFile( basedir, finalName, getClassifier() );
+ File jarFile = getJarFile( outputDirectory, finalName, getClassifier()
);
MavenArchiver archiver = new MavenArchiver();
@@ -138,7 +132,7 @@
try
{
- File contentDirectory = getOutputDirectory();
+ File contentDirectory = getClassesDirectory();
if ( !contentDirectory.exists() )
{
getLog().warn( "JAR will be empty - no content was marked for
inclusion!" );
Modified:
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
URL:
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java?rev=366416&r1=366415&r2=366416&view=diff
==============================================================================
---
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
(original)
+++
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
Thu Jan 5 20:07:11 2006
@@ -31,13 +31,12 @@
extends AbstractJarMojo
{
/**
- * Directory containing the classes.
- *
+ * Directory containing the classes.
+ *
* @parameter expression="${project.build.outputDirectory}"
* @required
- * @readonly
*/
- private File outputDirectory;
+ private File classesDirectory;
/**
* Classifier to add to the artifact generated. If given, the artifact
will be an attachment instead.
@@ -54,8 +53,8 @@
/**
* Return the main classes directory, so it's used as the root of the jar.
*/
- protected File getOutputDirectory()
+ protected File getClassesDirectory()
{
- return outputDirectory;
+ return classesDirectory;
}
}
Modified:
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java
URL:
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java?rev=366416&r1=366415&r2=366416&view=diff
==============================================================================
---
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java
(original)
+++
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java
Thu Jan 5 20:07:11 2006
@@ -35,9 +35,8 @@
*
* @parameter expression="${project.build.testOutputDirectory}"
* @required
- * @readonly
*/
- private File testOutputDirectory;
+ private File testClassesDirectory;
protected String getClassifier()
{
@@ -47,8 +46,8 @@
/**
* Return the test-classes directory, to serve as the root of the tests
jar.
*/
- protected File getOutputDirectory()
+ protected File getClassesDirectory()
{
- return testOutputDirectory;
+ return testClassesDirectory;
}
}