You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/05/11 18:26:29 UTC

[GitHub] geertjanw closed pull request #541: Fix maven output window links for newer versions of Maven

geertjanw closed pull request #541: Fix maven output window links for newer versions of Maven
URL: https://github.com/apache/incubator-netbeans/pull/541
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/maven/manifest.mf b/maven/manifest.mf
index d54d27143..20fce0d6b 100644
--- a/maven/manifest.mf
+++ b/maven/manifest.mf
@@ -1,6 +1,6 @@
 Manifest-Version: 1.0
 OpenIDE-Module: org.netbeans.modules.maven/2
-OpenIDE-Module-Specification-Version: 2.127
+OpenIDE-Module-Specification-Version: 2.128
 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/Bundle.properties
 OpenIDE-Module-Layer: org/netbeans/modules/maven/layer.xml
 AutoUpdate-Show-In-Client: false
diff --git a/maven/src/org/netbeans/modules/maven/output/TestOutputListenerProvider.java b/maven/src/org/netbeans/modules/maven/output/TestOutputListenerProvider.java
index d7d520c0b..cb586c27e 100644
--- a/maven/src/org/netbeans/modules/maven/output/TestOutputListenerProvider.java
+++ b/maven/src/org/netbeans/modules/maven/output/TestOutputListenerProvider.java
@@ -27,6 +27,7 @@
 import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
 import org.netbeans.api.java.classpath.ClassPath;
 import org.netbeans.api.project.FileOwnerQuery;
 import org.netbeans.api.project.Project;
@@ -42,6 +43,7 @@
 import org.openide.awt.StatusDisplayer;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
+import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
 import org.openide.util.NbBundle.Messages;
 import org.openide.util.RequestProcessor;
@@ -68,6 +70,7 @@
     private final Pattern outDirPattern;
     private final Pattern outDirPattern2;
     private final Pattern runningPattern;
+    private final Pattern runningPattern2;
     
     private static final Logger LOG = Logger.getLogger(TestOutputListenerProvider.class.getName());
 
@@ -84,12 +87,13 @@ public TestOutputListenerProvider() {
         runningPattern = Pattern.compile("(?:\\[surefire\\] )?Running (.*)", Pattern.DOTALL); //NOI18N
         outDirPattern = Pattern.compile(".*(?:Surefire)?(?:Failsafe)? report directory\\: (.*)", Pattern.DOTALL); //NOI18N
         outDirPattern2 = Pattern.compile(".*Setting reports dir\\: (.*)", Pattern.DOTALL); //NOI18N
+        runningPattern2 = Pattern.compile("^---\\smaven-surefire-plugin:\\d+\\.\\d+:test\\s.*$", Pattern.DOTALL);
     }
     
     public String[] getWatchedGoals() {
         return TESTGOALS;
     }
-    
+
     @Override
     public void processLine(String line, OutputVisitor visitor) {
         if (delayedLine != null) {
@@ -117,6 +121,21 @@ public void processLine(String line, OutputVisitor visitor) {
             runningTestClass = match.group(1);
             return;
         }
+        match = runningPattern2.matcher(line);
+        if (match.matches()) {
+            try {
+                Object defaultValue = PluginPropertyUtils.createEvaluator(visitor.getContext().getCurrentProject())
+                        .evaluate("${project.build.directory}/surefire-reports");
+                if (defaultValue instanceof String) {
+                    outputDir = (String) defaultValue;
+                    visitor.setOutputListener(new TestOutputListener(runningTestClass, outputDir), true);
+                }
+                return;
+            } catch (ExpressionEvaluationException ex) {
+                Exceptions.printStackTrace(ex);
+            }
+
+        }
         match = failSeparatePattern.matcher(line);
         if (match.matches()) {
             visitor.setOutputListener(new TestOutputListener(runningTestClass, outputDir), true);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists