6 Replies Latest reply on Apr 9, 2013 5:23 AM by b.eckenfels

    Build with Java 7 and -source 1.6 leads to warnings

    b.eckenfels

      Hello,

       

      the 7.2.0.Final is using the enforcer plugin to require Java 7 as a build environemnt. At the same time it specifies -source 1.6.0 in some modules. This leads to some warning messages about having a wrong (7) bootclasspath. Is this mix intentional? I know that there have been some problems with Java 7 in 7.1 (and hibernate), but I guess they are fixed when JDK 7 is enforced.

       

      Example:

       

      ...
      [INFO] ------------------------------------------------------------------------
      [INFO] Building JBoss Application Server: JAXR Client 7.2.0.Final
      [INFO] ------------------------------------------------------------------------
      ...
      [INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-java-version) @ jboss-as-jaxr ---
      [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jboss-as-jaxr ---
      [INFO] Compiling 19 source files to C:\ws\oss\jboss-as\jaxr\target\classes
      [WARNING] bootstrap class path not set in conjunction with -source 1.6
      ...
      

       

      All the following jboss-parent POMs seem to be used by the .Final build :-/ and all contain the 1.6 definition:

       

      $ grep 'compiler.source>1.6' /c/Users/eckenfel/.m2/repository/org/jboss/jboss-parent/*/jboss-parent-*.pom
      /c/Users/eckenfel/.m2/repository/org/jboss/jboss-parent/10/jboss-parent-10.pom:   <maven.compiler.source>1.6</maven.compiler.source>
      /c/Users/eckenfel/.m2/repository/org/jboss/jboss-parent/6-beta-1/jboss-parent-6-beta-1.pom:    <maven.compiler.source>1.6</maven.compiler.source>
      /c/Users/eckenfel/.m2/repository/org/jboss/jboss-parent/6-beta-2/jboss-parent-6-beta-2.pom:    <maven.compiler.source>1.6</maven.compiler.source>
      /c/Users/eckenfel/.m2/repository/org/jboss/jboss-parent/6/jboss-parent-6.pom: <maven.compiler.source>1.6</maven.compiler.source>
      /c/Users/eckenfel/.m2/repository/org/jboss/jboss-parent/7/jboss-parent-7.pom: <maven.compiler.source>1.6</maven.compiler.source>
      /c/Users/eckenfel/.m2/repository/org/jboss/jboss-parent/8/jboss-parent-8.pom: <maven.compiler.source>1.6</maven.compiler.source>
      /c/Users/eckenfel/.m2/repository/org/jboss/jboss-parent/9/jboss-parent-9.pom: <maven.compiler.source>1.6</maven.compiler.source>
      

       

      Greetings

      Bernd

        • 1. Re: Build with Java 7 and -source 1.6 leads to warnings
          jaikiran

          Bernd Eckenfels wrote:

           

          Hello,

           

          the 7.2.0.Final is using the enforcer plugin to require Java 7 as a build environemnt.

          It doesn't. AS 7.x requires Java 6 not Java 7. Where is it being enforced?

          1 of 1 people found this helpful
          • 2. Re: Build with Java 7 and -source 1.6 leads to warnings
            b.eckenfels

            jaikiran pai wrote:

            It doesn't. AS 7.x requires Java 6 not Java 7. Where is it being enforced?

            Yes, you are right, was looking at the wrong branch, it is actually 8.0.0.Alpha which requires the 1.7. by defining maven.compiler.source=1.7, and this is (via jboss-parent:10) set on the enforcer plugin.

             

            I checked, and I think the problem is the tools 1.6 systemPath dependency in the jboss-as/pom.xml of 8.0.0.

             

            This might be a possible fix (compile/test is still running): https://github.com/ecki/jboss-as/compare/topic-toolsfix

             

            Gruss

            Bernd

            • 3. Re: Build with Java 7 and -source 1.6 leads to warnings
              b.eckenfels

              Switching to 1.7 breaks the build with some convergence error (asm byteman / jboss-as-cluster). So the above branch cannot be merged, yet.

               

              There are some more places complaining about Java 7, like

               

              [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ jboss-as-naming ---

              [INFO] Changes detected - recompiling the module!

              [INFO] Compiling 11 source files to C:\ws\oss\jboss-as\naming\target\test-classes

              [WARNING] Supported source version 'RELEASE_6' from annotation processor 'org.sonatype.guice.bean.scanners.index.SisuIndexAPT6' less than -source '1.7'

              ...

              [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ jboss-as-jacorb ---

              [INFO] Changes detected - recompiling the module!

              [INFO] Compiling 2 source files to C:\ws\oss\jboss-as\jacorb\target\test-classes

              [WARNING] Supported source version 'RELEASE_6' from annotation processor 'org.sonatype.guice.bean.scanners.index.SisuIndexAPT6' less than -source '1.7'

              [WARNING] The following options were not recognized by any processor: '[generatedTranslationFilesPath]'

               

              Greetings

              Bernd

              • 4. Re: Build with Java 7 and -source 1.6 leads to warnings
                b.eckenfels

                Hello,

                Me wrote: Switching to 1.7 breaks the build with some convergence error (asm byteman / jboss-as-cluster). So the above branch cannot be merged, yet.

                 

                When I add the tools.jar in all places, the convergence problem is gone and AS8 builds and passes the tests: https://github.com/ecki/jboss-as/compare/topic-toolsfix is the branch, I will send a Pull request.

                 

                The other warnings about the annotation processing still exist.

                 

                Greetings

                Bernd

                • 5. Re: Build with Java 7 and -source 1.6 leads to warnings
                  ctomc

                  Just FYI,

                   

                  this tools.jar is only needed for byteman tests everything else works properly without this dependancy.

                   

                  and afaik this was only needed as explicit dependancy on mac...

                  • 6. Re: Build with Java 7 and -source 1.6 leads to warnings
                    b.eckenfels

                    It generates warnings in multiple places. Don't know if it is needed in any of them.