1 2 Previous Next 18 Replies Latest reply on Feb 23, 2010 7:57 AM by hardy.ferentschik

    Java 5 support?

    hardy.ferentschik
      I just tried to use Shrinkwrap 1.0.0-alpha-5 within a Java 5 project without success. It seems that the release is build with Java 6. Is Java 6 really a requirement? Couldn't Shrinkwrap not be build with target level 1.5? This way it should be consumable by Java 5 and 6 projects, right?
        • 1. Re: Java 5 support?
          alrubinger

          ShrinkWrap source presently depends upon JavaSE6.  JavaSE5 went EOL last November, though of course it's widely deployed today.

           

          Do we want to consider refitting things to support 5?

           

          S,

          ALR

          • 2. Re: Java 5 support?
            alrubinger

            Actually, I think we might just get away with source=1.5 on a 1.6 compiler.

             

            If I give you some binaries would you mind testing in your app?

             

            S,

            ALR

            • 3. Re: Java 5 support?
              aslak

              We don't use any SE 6 in trunk today do we?

               

              We've had a plan to rely on SE 6 for JAXB stuff in the Descriptors, but those are not committed yet..

              and I think it's possible to run JAXB with SE 5 as well, but as a external dep.

               

              ??

              • 4. Re: Java 5 support?
                alrubinger

                Yeah I was surprised this worked.  I wonder if the only feature we use is @Override on interface definitions; which can be handled by the 1.6 compiler and knocked down to class version 49 for Java5.

                 

                Descriptor stuff, IMO, should be outside api and impl-base anyway, in an extension component.  And with endorsed libs it can work in Java5 (we did in AS for years).  So I think we have something workable.

                 

                S,

                ALR

                • 5. Re: Java 5 support?
                  alrubinger

                  Until we sort this out, users may apply the following patch to shrinkwrap/trunk:

                  Index: build/pom.xml
                  ===================================================================
                  --- build/pom.xml    (revision 4016)
                  +++ build/pom.xml    (working copy)
                  @@ -70,8 +70,8 @@
                           <artifactId>maven-compiler-plugin</artifactId>
                           <inherited>true</inherited>
                           <configuration>
                  -          <source>1.6</source>
                  -          <target>1.6</target>
                  +          <source>1.5</source>
                  +          <target>1.5</target>
                             <showDeprecation>false</showDeprecation>
                             <showWarnings>true</showWarnings>
                             <optimize>true</optimize>
                  

                   

                  ...and build normally: ShrinkWrap | Development and Contribution

                   

                  S,

                  ALR

                  • 6. Re: Java 5 support?
                    hardy.ferentschik

                    I also think that just chaning the target level should do. If you push a new release I am happy to give it a go.

                     

                    Regarding JAXB - you can also use it with Java 5. Hibernate Validator uses this approach. We are building with JDK 6, but a target level of 1.5. On a Java 6 VM the JAX parsing works out of the box whereas on a Java 5 VM you have to add the jaxb dependencies.

                    • 7. Re: Java 5 support?
                      hardy.ferentschik

                      FYI - this is how we do it in the Validator pom - http://fisheye.jboss.org/browse/Hibernate/validator/trunk/pom.xml?r=18192

                      The JAXB dependencies are of type provided:

                       

                                  <dependency>
                                      <groupId>javax.xml.bind</groupId>
                      
                                      <artifactId>jaxb-api</artifactId>
                                      <version>2.2</version>
                                      <scope>provided</scope>
                                  </dependency>
                                  <dependency>
                                      <groupId>com.sun.xml.bind</groupId>
                                      <artifactId>jaxb-impl</artifactId>
                      
                                      <version>2.1.12</version>
                                      <scope>provided</scope>
                                  </dependency>
                      
                      

                       

                      We are using the jaxb2-maven-plugin plugin to generate the JAXB binding classes. Works like a charm.

                       

                      --Hardy

                      • 8. Re: Java 5 support?
                        alrubinger

                        https://jira.jboss.org/jira/browse/SHRINKWRAP-131

                         

                        Included in the attached.

                         

                        S,

                        ALR

                        • 9. Re: Java 5 support?
                          hardy.ferentschik
                          Any chance you can push the SNAPSHOT into snapshots.jboss.org? It would be much easier to consume.
                          • 10. Re: Java 5 support?
                            alrubinger

                            FYI the Hudson jobs do this automatically every night.  I've just pushed one manually so it's available now.

                             

                            Curious: whatcha doing?

                             

                            S,

                            ALR

                            • 11. Re: Java 5 support?
                              hardy.ferentschik

                              Finally had the time to test ShrinkWrap for the testing purposes I had in mind. Works just fine

                              Any change you guys can create a new rlease so that I don't have to depend on a SNAPSHOT?

                              • 12. Re: Java 5 support?
                                lightguard
                                There's an alpha-5 release I believe.
                                • 13. Re: Java 5 support?
                                  hardy.ferentschik
                                  alpha-5 is unfortunately still requires Java 6.
                                  • 14. Re: Java 5 support?
                                    alrubinger

                                    Sure we'll cut one this week for you.

                                     

                                    S,

                                    ALR

                                    1 2 Previous Next