Author: mcculls
Date: Sat Dec 8 03:18:23 2007
New Revision: 602449
URL: http://svn.apache.org/viewvc?rev=602449&view=rev
Log:
FELIX-433: must ensure directory exists before calling plexus unarchiver
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java?rev=602449&r1=602448&r2=602449&view=diff
==============================================================================
---
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
(original)
+++
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Sat Dec 8 03:18:23 2007
@@ -324,16 +324,31 @@
if (unpackBundle)
{
+ File outputDir = this.getOutputDirectory();
+ if (null == outputDir)
+ {
+ outputDir = new File( this.getBuildDirectory(), "classes"
);
+ }
+
try
{
+ /*
+ * this directory must exist before unpacking, otherwise
the plexus
+ * unarchiver decides to use the current working directory
instead!
+ */
+ if (!outputDir.exists())
+ {
+ outputDir.mkdirs();
+ }
+
UnArchiver unArchiver = archiverManager.getUnArchiver(
"jar" );
- unArchiver.setDestDirectory( getOutputDirectory() );
+ unArchiver.setDestDirectory( outputDir );
unArchiver.setSourceFile( jarFile );
unArchiver.extract();
}
catch ( Exception e )
{
- getLog().error( "Problem unpacking " + jarFile + " to " +
getOutputDirectory(), e );
+ getLog().error( "Problem unpacking " + jarFile + " to " +
outputDir, e );
}
}