Run hints from the current project's resources directory as well.
authorJan Lahoda <jlahoda@netbeans.org>
Wed, 31 Oct 2012 18:56:14 +0100
changeset 89912c21232b6e5
parent 898 20a2751b3866
child 900 de6375d3f9b4
Run hints from the current project's resources directory as well.
cmdline/maven/src/main/java/org/netbeans/modules/jackpot30/maven/RunJackpot30.java
cmdline/maven/tests/test-custom/golden
cmdline/maven/tests/test-custom/pom.xml
cmdline/maven/tests/test-custom/src/main/java/test/App.java
cmdline/maven/tests/test-custom/src/main/resources/META-INF/upgrade/test.hint
     1.1 --- a/cmdline/maven/src/main/java/org/netbeans/modules/jackpot30/maven/RunJackpot30.java	Tue Oct 30 17:46:50 2012 +0100
     1.2 +++ b/cmdline/maven/src/main/java/org/netbeans/modules/jackpot30/maven/RunJackpot30.java	Wed Oct 31 18:56:14 2012 +0100
     1.3 @@ -43,6 +43,7 @@
     1.4  import java.util.ArrayList;
     1.5  import java.util.List;
     1.6  import org.apache.maven.artifact.DependencyResolutionRequiredException;
     1.7 +import org.apache.maven.model.Resource;
     1.8  import org.apache.maven.plugin.AbstractMojo;
     1.9  import org.apache.maven.plugin.MojoExecutionException;
    1.10  import org.apache.maven.plugin.MojoFailureException;
    1.11 @@ -66,7 +67,11 @@
    1.12  
    1.13      public void execute() throws MojoExecutionException, MojoFailureException {
    1.14          try {
    1.15 -            List<String> compileSourceRoots = (List<String>) project.getCompileSourceRoots();
    1.16 +            List<String> compileSourceRoots = new ArrayList<String>();
    1.17 +            compileSourceRoots.addAll((List<String>) project.getCompileSourceRoots());
    1.18 +            for (Resource r : (List<Resource>) project.getResources()) {
    1.19 +                compileSourceRoots.add(r.getDirectory());
    1.20 +            }
    1.21              String sourceLevel = "1.5";
    1.22              Xpp3Dom sourceLevelConfiguration = Utils.getPluginConfiguration(project, "org.apache.maven.plugins", "maven-compiler-plugin");
    1.23  
    1.24 @@ -96,7 +101,7 @@
    1.25  
    1.26              boolean hasSourceRoots = false;
    1.27  
    1.28 -            for (String sr : compileSourceRoots) {
    1.29 +            for (String sr : (List<String>) project.getCompileSourceRoots()) {
    1.30                  if (!hasSourceRoots && new File(sr).isDirectory()) {
    1.31                      hasSourceRoots = true;
    1.32                  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/cmdline/maven/tests/test-custom/golden	Wed Oct 31 18:56:14 2012 +0100
     2.3 @@ -0,0 +1,3 @@
     2.4 +${basedir}/src/main/java/test/App.java:5: warning: [test] test
     2.5 +        System.err.println(args[0].length() == 0);
     2.6 +                           ^
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/cmdline/maven/tests/test-custom/pom.xml	Wed Oct 31 18:56:14 2012 +0100
     3.3 @@ -0,0 +1,34 @@
     3.4 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3.5 +  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     3.6 +  <modelVersion>4.0.0</modelVersion>
     3.7 +
     3.8 +  <groupId>org.netbeans.modules.jackpot30</groupId>
     3.9 +  <artifactId>maven-test</artifactId>
    3.10 +  <version>1.0-SNAPSHOT</version>
    3.11 +  <packaging>jar</packaging>
    3.12 +
    3.13 +  <name>jackpot30-maven-plugin-test1</name>
    3.14 +  <url>http://maven.apache.org</url>
    3.15 +
    3.16 +  <properties>
    3.17 +    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    3.18 +  </properties>
    3.19 +
    3.20 +  <dependencies>
    3.21 +    <dependency>
    3.22 +      <groupId>junit</groupId>
    3.23 +      <artifactId>junit</artifactId>
    3.24 +      <version>3.8.1</version>
    3.25 +      <scope>test</scope>
    3.26 +    </dependency>
    3.27 +  </dependencies>
    3.28 +  <build>
    3.29 +    <plugins>
    3.30 +      <plugin>
    3.31 +        <groupId>org.netbeans.modules.jackpot30</groupId>
    3.32 +        <artifactId>jackpot30-maven-plugin</artifactId>
    3.33 +        <version>1.0-SNAPSHOT</version>
    3.34 +      </plugin>
    3.35 +    </plugins>
    3.36 +  </build>
    3.37 +</project>
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/cmdline/maven/tests/test-custom/src/main/java/test/App.java	Wed Oct 31 18:56:14 2012 +0100
     4.3 @@ -0,0 +1,7 @@
     4.4 +package test;
     4.5 +
     4.6 +public class App  {
     4.7 +    public static void main(String[] args) {
     4.8 +        System.err.println(args[0].length() == 0);
     4.9 +    }
    4.10 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/cmdline/maven/tests/test-custom/src/main/resources/META-INF/upgrade/test.hint	Wed Oct 31 18:56:14 2012 +0100
     5.3 @@ -0,0 +1,1 @@
     5.4 +$str.length() == 0 :: $str instanceof java.lang.String;;