You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2015/06/12 18:24:58 UTC

svn commit: r1685123 - /uima/ruta/trunk/ruta-maven-plugin/src/main/java/org/apache/uima/ruta/maven/RutaGenerateDescriptorMojo.java

Author: pkluegl
Date: Fri Jun 12 16:24:57 2015
New Revision: 1685123

URL: http://svn.apache.org/r1685123
Log:
UIMA-4460
- fixed selection by name
- improved error message for failed build

Modified:
    uima/ruta/trunk/ruta-maven-plugin/src/main/java/org/apache/uima/ruta/maven/RutaGenerateDescriptorMojo.java

Modified: uima/ruta/trunk/ruta-maven-plugin/src/main/java/org/apache/uima/ruta/maven/RutaGenerateDescriptorMojo.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-maven-plugin/src/main/java/org/apache/uima/ruta/maven/RutaGenerateDescriptorMojo.java?rev=1685123&r1=1685122&r2=1685123&view=diff
==============================================================================
--- uima/ruta/trunk/ruta-maven-plugin/src/main/java/org/apache/uima/ruta/maven/RutaGenerateDescriptorMojo.java (original)
+++ uima/ruta/trunk/ruta-maven-plugin/src/main/java/org/apache/uima/ruta/maven/RutaGenerateDescriptorMojo.java Fri Jun 12 16:24:57 2015
@@ -277,7 +277,7 @@ public class RutaGenerateDescriptorMojo
         getLog().warn("Failed to parse UIMA Ruta script: " + scriptName, re);
       } catch (IOException ioe) {
         toBuild.add(descriptorInformation);
-        getLog().warn("Trying to build " + scriptName + ": " + ioe.toString());
+        getLog().warn("Tried to build " + scriptName + ", but failed (dependency probably not yet build): " + ioe.getMessage());
         count++;
       } catch (SAXException saxe) {
         getLog().warn("Failed to write descriptor: " + scriptName, saxe);
@@ -301,16 +301,25 @@ public class RutaGenerateDescriptorMojo
     String scriptName = file.getName().substring(0, file.getName().length() - 5);
 
     String aeName = scriptName + analysisEngineSuffix + ".xml";
-    String[] aeFiles = FileUtils.getFilesFromExtension(
-            analysisEngineOutputDirectory.getAbsolutePath(), new String[] { aeName });
-    if (aeFiles == null || aeFiles.length == 0) {
+    List<?> aeFiles = null;
+    try {
+      aeFiles = FileUtils.getFiles(analysisEngineOutputDirectory, aeName, null);
+    } catch (IOException e) {
+     return true;
+    }
+    if (aeFiles == null || aeFiles.size() == 0) {
       return true;
     }
 
-    String tsName = scriptName + typeSystemOutputDirectory + ".xml";
-    String[] tsFiles = FileUtils.getFilesFromExtension(typeSystemOutputDirectory.getAbsolutePath(),
-            new String[] { tsName });
-    if (tsFiles == null || tsFiles.length == 0) {
+    String tsName = scriptName + typeSystemSuffix + ".xml";
+    List<?> tsFiles;
+    try {
+      tsFiles = FileUtils.getFiles(typeSystemOutputDirectory, tsName, null);
+    } catch (IOException e) {
+      return true;
+    }
+    
+    if (tsFiles == null || tsFiles.size() == 0) {
       return true;
     }