Whirr
  1. Whirr
  2. WHIRR-319

Run rat & checkstyle before packaging

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.6.0
    • Component/s: None
    • Labels:
      None

      Description

      As Patrick suggested I believe this could help us avoid some release issues.

      1. WHIRR-319.patch
        16 kB
        Andrei Savu
      2. WHIRR-319.patch
        15 kB
        Tom White
      3. WHIRR-319.patch
        15 kB
        Andrei Savu
      4. mvn-checkstyle-X.log
        56 kB
        Andrei Savu
      5. checkstyle-result.xml
        310 kB
        Andrei Savu
      6. WHIRR-319.patch
        15 kB
        Andrei Savu
      7. WHIRR-319.patch
        14 kB
        Tom White

        Issue Links

          Activity

          Hide
          Tom White added a comment -

          Agreed. I'll take a look at this.

          Show
          Tom White added a comment - Agreed. I'll take a look at this.
          Hide
          Tom White added a comment -

          This patch

          • Upgrades to RAT 0.7.
          • Runs RAT and checkstyle as a part of the package phase.
          • Minimizes the number of RAT excludes we need by adding some missing headers to the service loader files in META-INF.
          • Excludes spurious log and svn .rej files from packaging since these have been mistakenly included in tarballs.
          • Excludes the binary Illustrator artwork file (whirr-logo.ai), since its not needed in distributions.
          • Fixes the source distribution to unpack to a directory that ends in '-src'.

          I've also updated the release wiki to add some more sanity checking of the artifacts around licensing.

          Show
          Tom White added a comment - This patch Upgrades to RAT 0.7. Runs RAT and checkstyle as a part of the package phase. Minimizes the number of RAT excludes we need by adding some missing headers to the service loader files in META-INF. Excludes spurious log and svn .rej files from packaging since these have been mistakenly included in tarballs. Excludes the binary Illustrator artwork file (whirr-logo.ai), since its not needed in distributions. Fixes the source distribution to unpack to a directory that ends in '-src'. I've also updated the release wiki to add some more sanity checking of the artifacts around licensing.
          Hide
          Andrei Savu added a comment -

          Updated patch to also ignore IDEA project files.

          Unfortunately checkstyle is failing for me. I've attached the log for core.

          Any ideas why? I need to do more global settings?

          Show
          Andrei Savu added a comment - Updated patch to also ignore IDEA project files. Unfortunately checkstyle is failing for me. I've attached the log for core. Any ideas why? I need to do more global settings?
          Hide
          Tom White added a comment -

          > Updated patch to also ignore IDEA project files.

          Does it cause a failure if you don't do this? I thought IDEA files are already excluded: http://incubator.apache.org/rat/apache-rat-plugin/check-mojo.html#useIdeaDefaultExcludes.

          > Unfortunately checkstyle is failing for me. I've attached the log for core.

          It looks like it's not picking up the checkstyle.xml. How are you invoking it? Which version of Maven are you using? It might be useful to try with -X to debug.

          Show
          Tom White added a comment - > Updated patch to also ignore IDEA project files. Does it cause a failure if you don't do this? I thought IDEA files are already excluded: http://incubator.apache.org/rat/apache-rat-plugin/check-mojo.html#useIdeaDefaultExcludes . > Unfortunately checkstyle is failing for me. I've attached the log for core. It looks like it's not picking up the checkstyle.xml. How are you invoking it? Which version of Maven are you using? It might be useful to try with -X to debug.
          Hide
          Andrei Savu added a comment -

          > Does it cause a failure if you don't do this? I thought IDEA files are already excluded.

          Yes, it fails because the patterns (*.iml, *.ipr and *.iws) are useless if the project is stored as a .idea folder.

          > How are you invoking it?

          mvn install (with the patch) OR mvn checkstyle:checkstyle from the root dir.

          > Which version of Maven are you using?

          $ mvn -V 
          Apache Maven 3.0.1 (r1038046; 2010-11-23 12:58:32+0200)
          Java version: 1.6.0_24
          Java home: /usr/lib/jvm/java-6-sun-1.6.0.24/jre
          Default locale: en_US, platform encoding: UTF-8
          OS name: "linux" version: "2.6.35-23-generic" arch: "i386" Family: "unix"
          
          Show
          Andrei Savu added a comment - > Does it cause a failure if you don't do this? I thought IDEA files are already excluded. Yes, it fails because the patterns (*.iml, *.ipr and *.iws) are useless if the project is stored as a .idea folder. > How are you invoking it? mvn install (with the patch) OR mvn checkstyle:checkstyle from the root dir. > Which version of Maven are you using? $ mvn -V Apache Maven 3.0.1 (r1038046; 2010-11-23 12:58:32+0200) Java version: 1.6.0_24 Java home: /usr/lib/jvm/java-6-sun-1.6.0.24/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux" version: "2.6.35-23-generic" arch: "i386" Family: "unix"
          Hide
          Andrei Savu added a comment -

          I've attached the output I get from running mvn -X checkstyle:checkstyle

          Show
          Andrei Savu added a comment - I've attached the output I get from running mvn -X checkstyle:checkstyle
          Hide
          Andrei Savu added a comment -

          I'm seeing the same error with the latest maven release (3.0.3).

          Show
          Andrei Savu added a comment - I'm seeing the same error with the latest maven release (3.0.3).
          Hide
          Andrei Savu added a comment -

          I don't get it why it doesn't work for me. Everything seems to be in place as recommended http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html

          BTW we should upgrade to checkstyle 2.6

          I will give it one more try on 64bit ubuntu server clean install in a VM.

          Show
          Andrei Savu added a comment - I don't get it why it doesn't work for me. Everything seems to be in place as recommended http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html BTW we should upgrade to checkstyle 2.6 I will give it one more try on 64bit ubuntu server clean install in a VM.
          Hide
          Andrei Savu added a comment -

          On a clean ubuntu 10.10 64bit server install with a clean trunk checkout + this patch first I've seen this error:

          [DEBUG] Could not find metadata org.apache.whirr:whirr-build-tools:0.6.0-incubating-SNAPSHOT/maven-metadata.xml in local (/root/.m2/repository)
          [DEBUG] Failure to find org.apache.whirr:whirr-build-tools:0.6.0-incubating-SNAPSHOT/maven-metadata.xml in https://repository.apache.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of apache-snapshots has elapsed or updates are forced
          [DEBUG] Failure to find org.apache.whirr:whirr-build-tools:0.6.0-incubating-SNAPSHOT/maven-metadata.xml in http://repository.apache.org/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced
          

          After doing a mvn install in build-tools I'm getting again the previous error again:

          [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.6:checkstyle (default-cli) on project whirr-core: An error has occurred in Checkstyle report generation. Failed during checkstyle execution: There are 1839 checkstyle errors. -> [Help 1]
          

          Maven version:

          Apache Maven 3.0.3 (r1075438; 2011-02-28 19:31:09+0200)
          Maven home: /root/apache-maven-3.0.3
          Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
          Java home: /usr/lib/jvm/java-6-sun-1.6.0.24/jre
          Default locale: en_US, platform encoding: UTF-8
          OS name: "linux", version: "2.6.35-27-server", arch: "amd64", family: "unix"
          

          I'm starting to think there is something wrong with the build and not with my local machine.

          Show
          Andrei Savu added a comment - On a clean ubuntu 10.10 64bit server install with a clean trunk checkout + this patch first I've seen this error: [DEBUG] Could not find metadata org.apache.whirr:whirr-build-tools:0.6.0-incubating-SNAPSHOT/maven-metadata.xml in local (/root/.m2/repository) [DEBUG] Failure to find org.apache.whirr:whirr-build-tools:0.6.0-incubating-SNAPSHOT/maven-metadata.xml in https://repository.apache.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of apache-snapshots has elapsed or updates are forced [DEBUG] Failure to find org.apache.whirr:whirr-build-tools:0.6.0-incubating-SNAPSHOT/maven-metadata.xml in http://repository.apache.org/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced After doing a mvn install in build-tools I'm getting again the previous error again: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.6:checkstyle (default-cli) on project whirr-core: An error has occurred in Checkstyle report generation. Failed during checkstyle execution: There are 1839 checkstyle errors. -> [Help 1] Maven version: Apache Maven 3.0.3 (r1075438; 2011-02-28 19:31:09+0200) Maven home: /root/apache-maven-3.0.3 Java version: 1.6.0_24, vendor: Sun Microsystems Inc. Java home: /usr/lib/jvm/java-6-sun-1.6.0.24/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.35-27-server", arch: "amd64", family: "unix" I'm starting to think there is something wrong with the build and not with my local machine.
          Hide
          Andrei Savu added a comment -

          Updated checkstyle from 2.5 to 2.6 and moved configLocation from reporting to the plugin definition. It now works for me.

          Show
          Andrei Savu added a comment - Updated checkstyle from 2.5 to 2.6 and moved configLocation from reporting to the plugin definition. It now works for me.
          Hide
          Tom White added a comment -

          I reproduced this with Maven 3, and the fix you suggested (included in this patch) works for me on both Maven 2.2.1 and 3.0.3.

          There's still a problem that you need to do mvn install in build-tools first, but I'm not sure how to fix that.

          Show
          Tom White added a comment - I reproduced this with Maven 3, and the fix you suggested (included in this patch) works for me on both Maven 2.2.1 and 3.0.3. There's still a problem that you need to do mvn install in build-tools first, but I'm not sure how to fix that.
          Hide
          Andrei Savu added a comment -

          There's still a problem that you need to do mvn install in build-tools first, but I'm not sure how to fix that.

          I've noticed that. I will try to find a workaround today.

          Show
          Andrei Savu added a comment - There's still a problem that you need to do mvn install in build-tools first, but I'm not sure how to fix that. I've noticed that. I will try to find a workaround today.
          Hide
          Andrei Savu added a comment -

          Attached a new patch with a workaround. It seems like it's working with Maven 3.0.3. Thanks Andrei Kalfas for helping with this one.

          Probably we should still check that deployed artifacts can be used as expected.

          Show
          Andrei Savu added a comment - Attached a new patch with a workaround. It seems like it's working with Maven 3.0.3. Thanks Andrei Kalfas for helping with this one. Probably we should still check that deployed artifacts can be used as expected.
          Hide
          Tom White added a comment -

          +1 This works for me. I also tried building from a submodule (core) and that worked too.

          Show
          Tom White added a comment - +1 This works for me. I also tried building from a submodule (core) and that worked too.
          Hide
          Andrei Savu added a comment -

          I've just committed this. Thanks Tom.

          Show
          Andrei Savu added a comment - I've just committed this. Thanks Tom.

            People

            • Assignee:
              Tom White
              Reporter:
              Andrei Savu
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development