Commits

Jan Lahoda committed bc529c1

Run hints from the current project's resources directory as well.

  • Participants
  • Parent commits 917b236

Comments (0)

Files changed (5)

File cmdline/maven/src/main/java/org/netbeans/modules/jackpot30/maven/RunJackpot30.java

 import java.util.ArrayList;
 import java.util.List;
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
+import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
         try {
-            List<String> compileSourceRoots = (List<String>) project.getCompileSourceRoots();
+            List<String> compileSourceRoots = new ArrayList<String>();
+            compileSourceRoots.addAll((List<String>) project.getCompileSourceRoots());
+            for (Resource r : (List<Resource>) project.getResources()) {
+                compileSourceRoots.add(r.getDirectory());
+            }
             String sourceLevel = "1.5";
             Xpp3Dom sourceLevelConfiguration = Utils.getPluginConfiguration(project, "org.apache.maven.plugins", "maven-compiler-plugin");
 
 
             boolean hasSourceRoots = false;
 
-            for (String sr : compileSourceRoots) {
+            for (String sr : (List<String>) project.getCompileSourceRoots()) {
                 if (!hasSourceRoots && new File(sr).isDirectory()) {
                     hasSourceRoots = true;
                 }

File cmdline/maven/tests/test-custom/golden

+${basedir}/src/main/java/test/App.java:5: warning: [test] test
+        System.err.println(args[0].length() == 0);
+                           ^

File cmdline/maven/tests/test-custom/pom.xml

+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.netbeans.modules.jackpot30</groupId>
+  <artifactId>maven-test</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>jackpot30-maven-plugin-test1</name>
+  <url>http://maven.apache.org</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.netbeans.modules.jackpot30</groupId>
+        <artifactId>jackpot30-maven-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </plugin>
+    </plugins>
+  </build>
+</project>

File cmdline/maven/tests/test-custom/src/main/java/test/App.java

+package test;
+
+public class App  {
+    public static void main(String[] args) {
+        System.err.println(args[0].length() == 0);
+    }
+}

File cmdline/maven/tests/test-custom/src/main/resources/META-INF/upgrade/test.hint

+$str.length() == 0 :: $str instanceof java.lang.String;;