You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by br...@apache.org on 2011/12/05 06:11:31 UTC

svn commit: r1210337 - /incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java

Author: brett
Date: Mon Dec  5 06:11:31 2011
New Revision: 1210337

URL: http://svn.apache.org/viewvc?rev=1210337&view=rev
Log:
show the XSD path being used in debug mode

Modified:
    incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java

Modified: incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java?rev=1210337&r1=1210336&r2=1210337&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java (original)
+++ incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java Mon Dec  5 06:11:31 2011
@@ -18,6 +18,7 @@
  */
 package npanday.plugin.xsd;
 
+import npanday.executable.NetExecutable;
 import npanday.registry.NPandayRepositoryException;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -31,6 +32,7 @@ import java.io.IOException;
 
 import npanday.executable.ExecutionException;
 import npanday.PlatformUnsupportedException;
+import org.codehaus.plexus.util.StringUtils;
 
 /**
  * Generates XSD class.
@@ -185,8 +187,14 @@ public class XsdGeneratorMojo
         FileUtils.mkdir( outputDirectory );
         try
         {
-            netExecutableFactory.getNetExecutableFor( vendor, frameworkVersion, profile, getCommands(),
-                                                      netHome ).execute();
+            NetExecutable exe = netExecutableFactory.getNetExecutableFor( vendor, frameworkVersion, profile,
+                                                                          getCommands(), netHome );
+            if ( getLog().isDebugEnabled() )
+            {
+                getLog().debug( "Running: " + exe.getExecutable() + " " + StringUtils.join(
+                    exe.getCommands().iterator(), " " ) );
+            }
+            exe.execute();
         }
         catch ( ExecutionException e )
         {



Re: svn commit: r1210337 - /incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java

Posted by Lars Corneliussen <me...@lcorneliussen.de>.
Hi,

1) Logging should be done in NetExecutable, since the surrounding context doesn't contribute anything to the log?
2) log entries should have NPANDAY-XXX-XXX, or?

_
Lars

Am 05.12.2011 um 07:11 schrieb brett@apache.org:

> Author: brett
> Date: Mon Dec  5 06:11:31 2011
> New Revision: 1210337
> 
> URL: http://svn.apache.org/viewvc?rev=1210337&view=rev
> Log:
> show the XSD path being used in debug mode
> 
> Modified:
>    incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java
> 
> Modified: incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java
> URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java?rev=1210337&r1=1210336&r2=1210337&view=diff
> ==============================================================================
> --- incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java (original)
> +++ incubator/npanday/trunk/plugins/maven-xsd-plugin/src/main/java/npanday/plugin/xsd/XsdGeneratorMojo.java Mon Dec  5 06:11:31 2011
> @@ -18,6 +18,7 @@
>  */
> package npanday.plugin.xsd;
> 
> +import npanday.executable.NetExecutable;
> import npanday.registry.NPandayRepositoryException;
> import org.apache.maven.plugin.AbstractMojo;
> import org.apache.maven.plugin.MojoExecutionException;
> @@ -31,6 +32,7 @@ import java.io.IOException;
> 
> import npanday.executable.ExecutionException;
> import npanday.PlatformUnsupportedException;
> +import org.codehaus.plexus.util.StringUtils;
> 
> /**
>  * Generates XSD class.
> @@ -185,8 +187,14 @@ public class XsdGeneratorMojo
>         FileUtils.mkdir( outputDirectory );
>         try
>         {
> -            netExecutableFactory.getNetExecutableFor( vendor, frameworkVersion, profile, getCommands(),
> -                                                      netHome ).execute();
> +            NetExecutable exe = netExecutableFactory.getNetExecutableFor( vendor, frameworkVersion, profile,
> +                                                                          getCommands(), netHome );
> +            if ( getLog().isDebugEnabled() )
> +            {
> +                getLog().debug( "Running: " + exe.getExecutable() + " " + StringUtils.join(
> +                    exe.getCommands().iterator(), " " ) );
> +            }
> +            exe.execute();
>         }
>         catch ( ExecutionException e )
>         {
> 
>