[Arakhnę-Dev] [295] * Make the error message more explicit.

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 295
Author:   galland
Date:     2011-10-20 12:18:27 +0200 (Thu, 20 Oct 2011)
Log Message:
-----------
* Make the error message more explicit.

Modified Paths:
--------------
    trunk/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java

Modified: trunk/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java
===================================================================
--- trunk/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java	2011-10-14 11:22:03 UTC (rev 294)
+++ trunk/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java	2011-10-20 10:18:27 UTC (rev 295)
@@ -1239,39 +1239,39 @@
     		this.next = null;
     		
     		while (this.next==null && !this.dependencies.isEmpty()) {
-    			try {
-    				Dependency dependency = this.dependencies.remove(0);
-    				if (dependency!=null) {
-    					String artifactId = dependency.getGroupId()+":"+dependency.getArtifactId()+":"+dependency.getVersion();  //$NON-NLS-1$//$NON-NLS-2$
-    					if (!this.treated.contains(artifactId)) {
-        					Artifact dependencyArtifact = createArtifact(
-        							dependency.getGroupId(),
-        							dependency.getArtifactId(),
-        							dependency.getVersion(),
-        							dependency.getScope(),
-        							dependency.getType());
-    						resolveArtifact(dependencyArtifact);
-    						MavenProjectBuilder builder = getMavenProjectBuilder();
-    						MavenProject dependencyProject = builder.buildFromRepository(
-    								dependencyArtifact,
-    								this.remoteRepositiories,
-    								getMavenSession().getLocalRepository());
-    						if (dependencyProject!=null) {
-    							if (this.isTransitive) {
-    								this.dependencies.addAll(dependencyProject.getDependencies());
-    							}
-    							this.next = dependencyProject;
-        						this.treated.add(artifactId);
-    						}
-    					}
-    				}
-    			}
-    			catch (MojoExecutionException e) {
-    				throw new NoSuchElementException();
-    			}
-    			catch (ProjectBuildingException e) {
-    				throw new NoSuchElementException();
-    			}
+				Dependency dependency = this.dependencies.remove(0);
+				if (dependency!=null) {
+					String artifactId = dependency.getGroupId()+":"+dependency.getArtifactId()+":"+dependency.getVersion();  //$NON-NLS-1$//$NON-NLS-2$
+					try {
+						if (!this.treated.contains(artifactId)) {
+							Artifact dependencyArtifact = createArtifact(
+									dependency.getGroupId(),
+									dependency.getArtifactId(),
+									dependency.getVersion(),
+									dependency.getScope(),
+									dependency.getType());
+							resolveArtifact(dependencyArtifact);
+							MavenProjectBuilder builder = getMavenProjectBuilder();
+							MavenProject dependencyProject = builder.buildFromRepository(
+									dependencyArtifact,
+									this.remoteRepositiories,
+									getMavenSession().getLocalRepository());
+							if (dependencyProject!=null) {
+								if (this.isTransitive) {
+									this.dependencies.addAll(dependencyProject.getDependencies());
+								}
+								this.next = dependencyProject;
+								this.treated.add(artifactId);
+							}
+						}
+					}
+					catch (MojoExecutionException e) {
+						throw new NoSuchElementException(artifactId);
+					}
+					catch (ProjectBuildingException e) {
+						throw new NoSuchElementException(artifactId);
+					}
+				}
     		}
     	}
     	


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/