From 022eb158aa10fa06e3eba7a1d49ab58a6d06163d Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Mon, 19 Oct 2009 13:16:21 +0200 Subject: Debigging NAR-25 on Windows --- src/main/java/org/apache/maven/plugin/nar/Javah.java | 16 ++++++++++++++-- src/main/java/org/apache/maven/plugin/nar/NarUtil.java | 1 - 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/org/apache/maven/plugin/nar/Javah.java b/src/main/java/org/apache/maven/plugin/nar/Javah.java index da104e6..2856972 100644 --- a/src/main/java/org/apache/maven/plugin/nar/Javah.java +++ b/src/main/java/org/apache/maven/plugin/nar/Javah.java @@ -31,14 +31,17 @@ import org.apache.bcel.classfile.ClassFormatException; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.maven.artifact.DependencyResolutionRequiredException; +import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.toolchain.Toolchain; +import org.apache.maven.toolchain.ToolchainManager; import org.codehaus.plexus.compiler.util.scan.InclusionScanException; import org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner; import org.codehaus.plexus.compiler.util.scan.StaleSourceScanner; import org.codehaus.plexus.compiler.util.scan.mapping.SingleTargetSourceMapping; import org.codehaus.plexus.compiler.util.scan.mapping.SuffixMapping; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; @@ -122,6 +125,15 @@ public class Javah * @parameter */ private File timestampFile; + + /** + * The current build session instance. + * + * @parameter expression="${session}" + * @required + * @readonly + */ + private MavenSession session; private AbstractCompileMojo mojo; @@ -236,8 +248,8 @@ public class Javah getTimestampDirectory().mkdirs(); File javahFile = new File( mojo.getJavaHome( mojo.getAOL() ), "bin" ); - String javah = new File(javahFile, name).getAbsolutePath(); - + String javah = new File( javahFile, name ).getAbsolutePath(); + mojo.getLog().info( "Running " + javah + " compiler on " + files.size() + " classes..." ); int result = NarUtil.runCommand( javah, generateArgs( files ), null, null, mojo.getLog() ); if ( result != 0 ) diff --git a/src/main/java/org/apache/maven/plugin/nar/NarUtil.java b/src/main/java/org/apache/maven/plugin/nar/NarUtil.java index 7e45013..2470e4e 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarUtil.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarUtil.java @@ -416,7 +416,6 @@ public class NarUtil try { - cmd = CommandLineUtils.quote( cmd ); log.debug( "RunCommand: " + cmd ); cmdLine.setExecutable( cmd ); if ( args != null ) -- cgit v1.2.3