Return-Path: Delivered-To: apmail-maven-dev-archive@www.apache.org Received: (qmail 21498 invoked from network); 5 Jun 2006 17:04:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jun 2006 17:04:18 -0000 Received: (qmail 94318 invoked by uid 500); 5 Jun 2006 17:04:18 -0000 Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 93707 invoked by uid 500); 5 Jun 2006 17:04:15 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 93696 invoked by uid 99); 5 Jun 2006 17:04:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 10:04:15 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of carlossg@gmail.com designates 64.233.184.229 as permitted sender) Received: from [64.233.184.229] (HELO wr-out-0506.google.com) (64.233.184.229) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 10:04:14 -0700 Received: by wr-out-0506.google.com with SMTP id 36so1108621wra for ; Mon, 05 Jun 2006 10:03:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=HOgD63lOBHh+sDctp2LOY3ILc1a6m5Zi7kY6rVbB0rg6J1f6V14f2yAEYKlshXvaHpZ4/UDm21HSwcBz6QQTvHmwWIFfX2XAqrE7KFLaBjt1TiIdPDMp67Oxf6fkqS2tG8+4DKGmPXrT0vVnp1b7xjka155gejtelCvYqsau3tA= Received: by 10.54.62.3 with SMTP id k3mr4796013wra; Mon, 05 Jun 2006 10:03:50 -0700 (PDT) Received: by 10.54.102.19 with HTTP; Mon, 5 Jun 2006 10:03:52 -0700 (PDT) Message-ID: <1a5b6c410606051003q3ac44578w97e50e2c590a04ea@mail.gmail.com> Date: Mon, 5 Jun 2006 10:03:52 -0700 From: "Carlos Sanchez" Sender: carlossg@gmail.com To: "Maven Developers List" Subject: Re: svn commit: r410628 - /maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java In-Reply-To: <541f12ca0606050212k3ccc6923oec5252f00eaf7e1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20060531182114.A57FF1A9842@eris.apache.org> <541f12ca0606050212k3ccc6923oec5252f00eaf7e1@mail.gmail.com> X-Google-Sender-Auth: 29f4e2be09b0ee32 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Yep, that'd be better. Still this is better than the previous one ;) On 6/5/06, Stephane Nicoll wrote: > What's the purpose of these multiple catch statements if they just > deliver the same message? I think it would make sense to deliver a > message strongly linked to the exception's type being catched. > > WDYT? > > s/ > > > > On 5/31/06, carlos@apache.org wrote: > > Author: carlos > > Date: Wed May 31 11:21:13 2006 > > New Revision: 410628 > > > > URL: http://svn.apache.org/viewvc?rev=410628&view=rev > > Log: > > Improve error handling > > > > Modified: > > maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java > > > > Modified: maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java > > URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java?rev=410628&r1=410627&r2=410628&view=diff > > ============================================================================== > > --- maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java (original) > > +++ maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java Wed May 31 11:21:13 2006 > > @@ -18,13 +18,17 @@ > > > > import org.apache.maven.archiver.MavenArchiveConfiguration; > > import org.apache.maven.archiver.MavenArchiver; > > +import org.apache.maven.artifact.DependencyResolutionRequiredException; > > import org.apache.maven.plugin.AbstractMojo; > > import org.apache.maven.plugin.MojoExecutionException; > > import org.apache.maven.project.MavenProject; > > import org.apache.maven.project.MavenProjectHelper; > > +import org.codehaus.plexus.archiver.ArchiverException; > > import org.codehaus.plexus.archiver.jar.JarArchiver; > > +import org.codehaus.plexus.archiver.jar.ManifestException; > > > > import java.io.File; > > +import java.io.IOException; > > import java.util.List; > > > > /** > > @@ -221,48 +225,78 @@ > > > > // create archive > > archiver.createArchive( project, archive ); > > + } > > + catch ( ArchiverException e ) > > + { > > + throw new MojoExecutionException( "There was a problem creating the EJB archive: " + e.getMessage() , e ); > > + } > > + catch ( ManifestException e ) > > + { > > + throw new MojoExecutionException( "There was a problem creating the EJB archive: " + e.getMessage() , e ); > > + } > > + catch ( IOException e ) > > + { > > + throw new MojoExecutionException( "There was a problem creating the EJB archive: " + e.getMessage() , e ); > > + } > > + catch ( DependencyResolutionRequiredException e ) > > + { > > + throw new MojoExecutionException( "There was a problem creating the EJB archive: " + e.getMessage() , e ); > > + } > > > > - project.getArtifact().setFile( jarFile ); > > + project.getArtifact().setFile( jarFile ); > > > > - if ( new Boolean( generateClient ).booleanValue() ) > > - { > > - getLog().info( "Building ejb client " + jarName + "-client" ); > > + if ( Boolean.parseBoolean( generateClient ) ) > > + { > > + getLog().info( "Building ejb client " + jarName + "-client" ); > > > > - String[] excludes = DEFAULT_EXCLUDES; > > - String[] includes = DEFAULT_INCLUDES; > > + String[] excludes = DEFAULT_EXCLUDES; > > + String[] includes = DEFAULT_INCLUDES; > > > > - if ( clientIncludes != null && !clientIncludes.isEmpty() ) > > - { > > - includes = (String[]) clientIncludes.toArray( EMPTY_STRING_ARRAY ); > > - } > > + if ( clientIncludes != null && !clientIncludes.isEmpty() ) > > + { > > + includes = (String[]) clientIncludes.toArray( EMPTY_STRING_ARRAY ); > > + } > > > > - if ( clientExcludes != null && !clientExcludes.isEmpty() ) > > - { > > - excludes = (String[]) clientExcludes.toArray( EMPTY_STRING_ARRAY ); > > - } > > + if ( clientExcludes != null && !clientExcludes.isEmpty() ) > > + { > > + excludes = (String[]) clientExcludes.toArray( EMPTY_STRING_ARRAY ); > > + } > > > > - File clientJarFile = new File( basedir, jarName + "-client.jar" ); > > + File clientJarFile = new File( basedir, jarName + "-client.jar" ); > > > > - MavenArchiver clientArchiver = new MavenArchiver(); > > + MavenArchiver clientArchiver = new MavenArchiver(); > > > > - clientArchiver.setArchiver( clientJarArchiver ); > > + clientArchiver.setArchiver( clientJarArchiver ); > > > > - clientArchiver.setOutputFile( clientJarFile ); > > + clientArchiver.setOutputFile( clientJarFile ); > > > > - clientArchiver.getArchiver().addDirectory( > > - new File( outputDirectory ), includes, excludes ); > > + try > > + { > > + clientArchiver.getArchiver().addDirectory( new File( outputDirectory ), includes, excludes ); > > > > // create archive > > clientArchiver.createArchive( project, archive ); > > > > - // TODO: shouldn't need classifer > > - projectHelper.attachArtifact( project, "ejb-client", "client", clientJarFile ); > > } > > - } > > - catch ( Exception e ) > > - { > > - // TODO: improve error handling > > - throw new MojoExecutionException( "Error assembling EJB", e ); > > + catch ( ArchiverException e ) > > + { > > + throw new MojoExecutionException( "There was a problem creating the EJB client archive: " + e.getMessage() , e ); > > + } > > + catch ( ManifestException e ) > > + { > > + throw new MojoExecutionException( "There was a problem creating the EJB client archive: " + e.getMessage() , e ); > > + } > > + catch ( IOException e ) > > + { > > + throw new MojoExecutionException( "There was a problem creating the EJB client archive: " + e.getMessage() , e ); > > + } > > + catch ( DependencyResolutionRequiredException e ) > > + { > > + throw new MojoExecutionException( "There was a problem creating the EJB client archive: " + e.getMessage() , e ); > > + } > > + > > + // TODO: shouldn't need classifer > > + projectHelper.attachArtifact( project, "ejb-client", "client", clientJarFile ); > > } > > } > > } > > > > > > > > > -- > .::You're welcome ::. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org > For additional commands, e-mail: dev-help@maven.apache.org > > -- I could give you my word as a Spaniard. No good. I've known too many Spaniards. -- The Princess Bride --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org