Solved,

thank you for your remarks

On Tue, Dec 27, 2011 at 11:32 AM, Robert Scholte <[email protected]>wrote:

>  I doubt Codehaus is your employer. IMO this should be empty.
>
> -Robert
> ------------------------------
> From: [email protected]
> To: [email protected]
> Date: Mon, 26 Dec 2011 17:33:23 -0600
> Subject: [mojo-scm] [15622] trunk/mojo/was6-maven-plugin: MWAS-62: Skip
> does not work for ejbdeploy
>
>  Revision 15622 <http://fisheye.codehaus.org/changelog/mojo/?cs=15622>
> Author jmz Date 2011-12-26 17:33:23 -0600 (Mon, 26 Dec 2011) Log Message
>
> MWAS-62: Skip does not work for ejbdeploy
>
> Modified Paths
>
>    - 
> trunk/mojo/was6-maven-plugin/pom.xml<#1347f1463bd4c757_trunkmojowas6mavenpluginpomxml>
>    -
>    
> trunk/mojo/was6-maven-plugin/src/main/java/org/codehaus/mojo/was6/AbstractWas6Mojo.java<#1347f1463bd4c757_trunkmojowas6mavenpluginsrcmainjavaorgcodehausmojowas6AbstractWas6Mojojava>
>    -
>    
> trunk/mojo/was6-maven-plugin/src/main/java/org/codehaus/mojo/was6/EjbDeployMojo.java<#1347f1463bd4c757_trunkmojowas6mavenpluginsrcmainjavaorgcodehausmojowas6EjbDeployMojojava>
>
>  Diff
> Modified: trunk/mojo/was6-maven-plugin/pom.xml (15621 => 15622)
>
> --- trunk/mojo/was6-maven-plugin/pom.xml      2011-12-26 23:01:22 UTC (rev 
> 15621)
> +++ trunk/mojo/was6-maven-plugin/pom.xml      2011-12-26 23:33:23 UTC (rev 
> 15622)@@ -62,6 +62,18 @@       </roles>       <timezone>1</timezone>     
> </developer>+     <developer>
> +      <id>jmz</id>
> +      <name>Javier Murciego</name>
> +      <email>[email protected]</email>
> +      <url>https://github.com/jmurciego</url>
> +      <organization>codehaus.org</organization>
> +      <organizationUrl>http://www.codehaus.org</organizationUrl>
> +      <roles>
> +        <role>developer</role>
> +      </roles>
> +      <timezone>1</timezone>
> +    </developer>   </developers>   <contributors>     <contributor>@@ -74,6 
> +86,16 @@       </roles>       <timezone>10</timezone>     </contributor>+    
> <contributor>
> +      <email>[email protected]</email>
> +      <name>Kim Heftø</name>
> +      <organization></organization>
> +      <organizationUrl></organizationUrl>
> +      <roles>
> +        <role>developer</role>
> +      </roles>
> +      <timezone>10</timezone>
> +    </contributor>   </contributors>   <licenses>     <license>
>
>  Modified:
> trunk/mojo/was6-maven-plugin/src/main/java/org/codehaus/mojo/was6/AbstractWas6Mojo.java
> (15621 => 15622)
>
> --- 
> trunk/mojo/was6-maven-plugin/src/main/java/org/codehaus/mojo/was6/AbstractWas6Mojo.java
>    2011-12-26 23:01:22 UTC (rev 15621)
> +++ 
> trunk/mojo/was6-maven-plugin/src/main/java/org/codehaus/mojo/was6/AbstractWas6Mojo.java
>    2011-12-26 23:33:23 UTC (rev 15622)@@ -161,6 +161,16 @@     }      /**+    
>  * Returns true if skip.
> +     * @return skip value.
> +     */
> +    protected boolean isSkip()
> +    {
> +        return skip;
> +    }
> +
> +
> +    /**      * Locates the ws_ant.sh|bat executable.      *       * @return 
> a File pointing on the executable@@ -339,9 +349,7 @@     public void 
> execute()         throws MojoExecutionException, MojoFailureException     {-  
>       if ( skip ) {
> -            getLog().info( "Skipping execution" );
> -        }+               if ( wasHome == null )         {             throw 
> new MojoExecutionException( "wasHome not defined" );
>
>  Modified:
> trunk/mojo/was6-maven-plugin/src/main/java/org/codehaus/mojo/was6/EjbDeployMojo.java
> (15621 => 15622)
>
> --- 
> trunk/mojo/was6-maven-plugin/src/main/java/org/codehaus/mojo/was6/EjbDeployMojo.java
>       2011-12-26 23:01:22 UTC (rev 15621)
> +++ 
> trunk/mojo/was6-maven-plugin/src/main/java/org/codehaus/mojo/was6/EjbDeployMojo.java
>       2011-12-26 23:33:23 UTC (rev 15622)@@ -222,60 +222,64 @@     public 
> void execute()         throws MojoExecutionException, MojoFailureException    
>  {-           if ( !getMavenProject().getPackaging().equalsIgnoreCase( "ejb" 
> ) )
> -        {
> -            throw new MojoExecutionException( "Invalid packaging type, this 
> plugin can only be applied to ejb packaging type projects" );
> -        }
> -     
> -        super.execute();
> -
> -        if ( !getOutputJarFile().exists() )  //TODO: Solve generically - 
> MWAS-14 - why doesn't failOnError fail the build and ws_ant return a 
> returncode != 0?
> -        {
> -            throw new MojoExecutionException( "Deployment failed - see 
> previous errors" );
> -        }
> -
> -        File[] workingDirectorySubdirs =
> -            getWorkingDirectory().listFiles( (java.io.FileFilter) 
> DirectoryFileFilter.DIRECTORY );
> -        if ( workingDirectorySubdirs.length == 1 )
> -        {
> -            // copy sources
> -            File generatedSources = new File( workingDirectorySubdirs[0], 
> getMavenProject().getBuild().getFinalName() + classifier + File.separator + 
> "ejbModule" );
> -            try+        if(!isSkip()){
> +            if ( !getMavenProject().getPackaging().equalsIgnoreCase( "ejb" ) 
> )             {-                FileUtils.copyDirectory( generatedSources, 
> getGeneratedSourcesDirectory() );
> -                FileUtils.deleteDirectory( new File( 
> getGeneratedSourcesDirectory(), "META-INF" ) );+                throw new 
> MojoExecutionException( "Invalid packaging type, this plugin can only be 
> applied to ejb packaging type projects" );             }-            catch ( 
> IOException e )+
> +            super.execute();
> +
> +            if ( !getOutputJarFile().exists() )  //TODO: Solve generically - 
> MWAS-14 - why doesn't failOnError fail the build and ws_ant return a 
> returncode != 0?             {-                throw new 
> MojoExecutionException( "Error copying generated sources", e );+              
>   throw new MojoExecutionException( "Deployment failed - see previous errors" 
> );             } -            List compileSourceRoots = 
> getMavenProject().getCompileSourceRoots();
> -            compileSourceRoots.add( getGeneratedSourcesDirectory().getPath() 
> );+            File[] workingDirectorySubdirs =
> +                getWorkingDirectory().listFiles( (java.io.FileFilter) 
> DirectoryFileFilter.DIRECTORY );
> +            if ( workingDirectorySubdirs.length == 1 )
> +            {
> +                // copy sources
> +                File generatedSources = new File( 
> workingDirectorySubdirs[0], getMavenProject().getBuild().getFinalName() + 
> classifier + File.separator + "ejbModule" );
> +                try
> +                {
> +                    FileUtils.copyDirectory( generatedSources, 
> getGeneratedSourcesDirectory() );
> +                    FileUtils.deleteDirectory( new File( 
> getGeneratedSourcesDirectory(), "META-INF" ) );
> +                }
> +                catch ( IOException e )
> +                {
> +                    throw new MojoExecutionException( "Error copying 
> generated sources", e );
> +                } -            // copy generated classes
> -            File generatedClasses =
> -                new File( workingDirectorySubdirs[0], 
> getMavenProject().getBuild().getFinalName() + classifier + File.separator +
> -                    "build" + File.separator + "classes" );+                
> List compileSourceRoots = getMavenProject().getCompileSourceRoots();
> +                compileSourceRoots.add( 
> getGeneratedSourcesDirectory().getPath() ); -            try
> -            {
> -                FileUtils.copyDirectory( generatedClasses, 
> getGeneratedClassesDirectory() );
> -                Resource resource = new Resource();
> -                resource.setDirectory( 
> getGeneratedClassesDirectory().getPath() );
> -                getMavenProject().getResources().add( resource );+           
>      // copy generated classes
> +                File generatedClasses =
> +                    new File( workingDirectorySubdirs[0], 
> getMavenProject().getBuild().getFinalName() + classifier + File.separator +
> +                        "build" + File.separator + "classes" );
> +
> +                try
> +                {
> +                    FileUtils.copyDirectory( generatedClasses, 
> getGeneratedClassesDirectory() );
> +                    Resource resource = new Resource();
> +                    resource.setDirectory( 
> getGeneratedClassesDirectory().getPath() );
> +                    getMavenProject().getResources().add( resource );
> +                }
> +                catch ( IOException e )
> +                {
> +                    throw new MojoExecutionException( "Error copying 
> generated classes", e );
> +                }             }-            catch ( IOException e )+         
>    else             {-                throw new MojoExecutionException( 
> "Error copying generated classes", e );+                getLog().warn( "No 
> sources were generated" );             }-        }
> -        else
> -        {
> -            getLog().warn( "No sources were generated" );
> -        } -        getLog().info( "ejbDeploy finished" );+            
> getLog().info( "ejbDeploy finished" );
> +        }else{
> +            getLog().info( "Skipping execution" );
> +     }     }      /**
>
>  ------------------------------
> To unsubscribe from this list please visit:
> http://xircles.codehaus.org/manage_email
>

Reply via email to