I can build using the java 7 compiler no problem, but is it possible to output
java 7 as well?
There are three places in the parent pom that I can see where the java version
comes into play. (pasted below)
I tried building with:
mvn clean install -Dsling.java.version=7 -e
And I get the exception that's shown in the maven-antrun-plugin in the pom.
Building with:
mvn clean install -Dsling.java.version=6 -e
works fine.
I can live with Java 6, but it's EOL'd by Oracle at this point. And when I
build one of my own bundles with java 7 as the target and install it into sling
built to another java version (I'm not sure if it was 5 or 6), I get errors
that look like byte code incompatibility problems.
Rob
parent/pom.xml:
<properties>
<site.jira.version.id>12313945</site.jira.version.id>
<site.javadoc.exclude />
<organization.logo>http://sling.apache.org/site/media.data/logo.png</organization.logo>
<!--
Java API and class file compliance. This property supports
one of two values:
- 5: Java 1.5 (default)
- 6: Java 6
Using anything else causes the
set-bundle-required-execution-environment
to fail the build with an exception
-->
<sling.java.version>5</sling.java.version>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.${sling.java.version}</source>
<target>1.${sling.java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>check-memory-task</id>
<phase>process-resources</phase>
<configuration>
<target>
<echo>
**************** WARNING (SLING-443/SLING-1782) ******************************
On most platforms, you'll get OutOfMemoryErrors when building unless you set
on 32bit platforms: MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=256M", see SLING-443
on 64bit platforms: MAVEN_OPTS="-Xmx512M -XX:MaxPermSize=512M", see SLING-1782
******************************************************************************
</echo>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>set-bundle-required-execution-environment</id>
<goals>
<goal>run</goal>
</goals>
<phase>initialize</phase>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<script language="javascript"> <![CDATA[
var System = java.lang.System;
var bree = "J2SE-1.5";
var slingJavaVersion =
System.getProperty("sling.java.version");
if (!slingJavaVersion) {
slingJavaVersion =
project.getProperty("sling.java.version");
}
if (slingJavaVersion == "6") {
bree = "JavaSE-1.6";
System.out.println("Setting
Bundle-RequiredExecutionEnvironment=" + bree + " from sling.java.version=" +
slingJavaVersion);
} else if (slingJavaVersion != "5") {
System.out.println("Unsupported
sling.java.version=" + slingJavaVersion + "; must be 5 or 6.");
throw "sling.java.version must be 5 or
6";
}
project.setProperty("sling.bree", bree);
]]></script>
</target>
</configuration>
</execution>
</executions>
</plugin>
On Oct 20, 2013, at 3:19 PM, Carsten Ziegeler wrote:
> I just did a test build of latest trunk on Mac OSX - and it runs fine for
> me.
>
> Carsten
>
>
> 2013/10/20 Carsten Ziegeler <[email protected]>
>
>> Hi,
>>
>> no, we support java 7 as well, so everything should work with it, however,
>> it's most like the java version we have tested the least with
>>
>> Carsten
>>
>>
>> 2013/10/19 Robert A. Decker <[email protected]>
>>
>> Hi, I just noticed that you were building under java 1.7 and not 1.6. You
>>> can probably get around the problem by skipping the tests, but if you look
>>> at the sling-builder/parent/pom.xml it looks like only 1.5 and 1.6 are
>>> supported.
>>>
>>> Rob
>>>
>>> On Oct 17, 2013, at 7:33 AM, maremv wrote:
>>>
>>>> I am trying to build sling with java 1.7 . It builds fine, but it keeps
>>> failing at different places in the test procedures. And the project that
>>> the test fails on - if i open that maven project i can build and test it
>>> just fine. Any ideas? -thanks
>>>>
>>>> -logging-api[org.ops4j.pax.logging.internal.Activator] : Disabling
>>> Avalon Logger API support.
>>>>
>>> org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]
>>> : Disabling JULI Logger API support.
>>>> 672803 [main] INFO org.ops4j.pax.exam.spi.reactors.ReactorManager -
>>> suite finished
>>>> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.194
>>> sec
>>>>
>>>> Results :
>>>>
>>>> Tests in error:
>>>> testRoundRobinQueue(org.apache.sling.event.it.RoundRobinQueueTest):
>>> test timed out after 300000 milliseconds
>>>>
>>>> Tests run: 18, Failures: 0, Errors: 1, Skipped: 0
>>>>
>>>> File encoding has not been set, using platform encoding UTF-8, i.e.
>>> build is platform dependent!
>>>>
>>>> [ianal:verify-legal-files]
>>>> Checking legal files in: org.apache.sling.event-3.2.1-SNAPSHOT.jar
>>>> Checking legal files in:
>>> org.apache.sling.event-3.2.1-SNAPSHOT-sources.jar
>>>>
>>>> [failsafe:verify]
>>>> Failsafe report directory:
>>> /home/daddy/Code/OPEN_SOURCE/apache/sling/trunk/bundles/extensions/event/target/failsafe-reports
>>>> File encoding has not been set, using platform encoding UTF-8, i.e.
>>> build is platform dependent!
>>>> ------------------------------------------------------------------------
>>>> Reactor Summary:
>>>>
>>>> Apache Sling JAR Resource Bundle .................. SUCCESS [1.124s]
>>>> Apache Sling (Parent) ............................. SUCCESS [2.934s]
>>>> Sling Adapter Annotations ......................... SUCCESS [2.493s]
>>>> Apache Sling Maven Plugin to create Jackrabbit OCM descriptors SUCCESS
>>> [2.097s]
>>>> Apache Sling Maven Plugin for Compiling JSP Sources into Bundles
>>> SUCCESS [1.591s]
>>>> Apache Sling Maven Plugin for Supporting Bundle Development SUCCESS
>>> [1.335s]
>>>> Apache Sling Launchpad Maven Plugin ............... SUCCESS [6.216s]
>>>> Sling Launchpad Standalone Archetype .............. SUCCESS [1.897s]
>>>> Sling Launchpad Webapp Archetype .................. SUCCESS [0.543s]
>>>> Sling Initial Content Archetype ................... SUCCESS [0.537s]
>>>> Sling Servlet Archetype ........................... SUCCESS [11.733s]
>>>> Sling Bundle Archetype ............................ SUCCESS [0.553s]
>>>> Sling JCRInstall Bundle Archetype ................. SUCCESS [0.518s]
>>>> Sling Taglib Archetype ............................ SUCCESS [0.597s]
>>>> Apache Sling API .................................. SUCCESS [3.419s]
>>>> Apache Sling Service User Mapper .................. SUCCESS [1.489s]
>>>> Apache Sling Resource Resolver .................... SUCCESS [2.780s]
>>>> Apache Sling System Bundle Extension: Java Transaction API SUCCESS
>>> [0.751s]
>>>> Apache Sling System Bundle Extension: XML APIs .... SUCCESS [0.538s]
>>>> Apache Sling System Bundle Extension: Activation API SUCCESS [0.535s]
>>>> Apache Sling System Bundle Extension: WS APIs ..... SUCCESS [0.534s]
>>>> Apache Sling Dynamic Class Loader Support ......... SUCCESS [1.470s]
>>>> Apache Sling JSON Library ......................... SUCCESS [0.899s]
>>>> Apache Sling SLF4J Implementation (Logback) ....... SUCCESS [25.225s]
>>>> Apache Sling OSGi LogService Implementation ....... SUCCESS [0.626s]
>>>> Apache Sling MIME type mapping support ............ SUCCESS [3.278s]
>>>> Apache Sling Commons OSGi support ................. SUCCESS [1.092s]
>>>> Apache Sling Scheduler Support .................... SUCCESS [3.484s]
>>>> Apache Sling Testing Utilities .................... SUCCESS [10.678s]
>>>> Apache Sling Thread Support ....................... SUCCESS [0.776s]
>>>> Apache Sling Authentication Service ............... SUCCESS [1.605s]
>>>> Apache Sling OpenID Authentication ................ SUCCESS [3.481s]
>>>> Apache Sling Form Based Authentication Handler .... SUCCESS [3.038s]
>>>> Apache Sling Authentication Selector .............. SUCCESS [0.800s]
>>>> Apache Sling Engine Implementation ................ SUCCESS [23.322s]
>>>> Apache Sling Repository API Bundle ................ SUCCESS [0.638s]
>>>> Apache Sling JCR Base Bundle ...................... SUCCESS [1.144s]
>>>> Apache Sling JCR ClassLoader ...................... SUCCESS [0.721s]
>>>> Apache Sling Initial Content Loader ............... SUCCESS [2.292s]
>>>> Apache Sling Jackrabbit Embedded Repository ....... SUCCESS [3.719s]
>>>> Apache Sling Jackrabbit UserManager Support ....... SUCCESS [1.284s]
>>>> Apache Sling Jackrabbit JSR-283 Access Control Manager Support SUCCESS
>>> [0.776s]
>>>> Apache Sling Wrapper Bundle for the JCR API ....... SUCCESS [0.492s]
>>>> Apache Sling Object Content Mapping ............... SUCCESS [1.648s]
>>>> Apache Sling JCR Resource Resolver ................ SUCCESS [50.038s]
>>>> Apache Sling JCR Repository Registration .......... SUCCESS [2.467s]
>>>> Apache Sling Simple WebDAV Access to repositories . SUCCESS [1.323s]
>>>> Apache Sling DavEx Access to repositories ......... SUCCESS [1.532s]
>>>> Apache Sling JCR WebConsole Bundle ................ SUCCESS [0.676s]
>>>> Apache Sling Servlet Resolver ..................... SUCCESS [1.628s]
>>>> Apache Sling Default GET Servlets ................. SUCCESS [1.344s]
>>>> Apache Sling Default POST Servlets ................ SUCCESS [1.970s]
>>>> Apache Sling Compat Servlets ...................... SUCCESS [0.722s]
>>>> Apache Sling Scripting Implementation API ......... SUCCESS [0.660s]
>>>> Apache Sling Scripting Core implementation ........ SUCCESS [4.349s]
>>>> Apache Sling Scripting JavaScript Support ......... SUCCESS [6.912s]
>>>> Apache Sling Scripting JSP Support ................ SUCCESS [3.334s]
>>>> Apache Sling JSP Tag Library ...................... SUCCESS [1.513s]
>>>> Apache Sling JSP Standard Tag Library ............. SUCCESS [0.900s]
>>>> Apache Sling Adapter Manager Implementation ....... SUCCESS [1.168s]
>>>> Apache Sling Bundle Resource Provider ............. SUCCESS [0.649s]
>>>> Apache Sling Discovery API ........................ SUCCESS [0.631s]
>>>> Apache Sling Resource-Based Discovery Service ..... SUCCESS [2:15.485s]
>>>> Apache Sling Discovery Support Bundle ............. SUCCESS [0.687s]
>>>> Apache Sling Discovery Standalone Implementation .. SUCCESS [0.648s]
>>>> Apache Sling Event Support ........................ FAILURE [11:16.810s]
>>>> Apache Sling Filesystem Resource Provider ......... SKIPPED
>>>> Apache Sling javax.activation bundle .............. SKIPPED
>>>> Apache Sling Settings ............................. SKIPPED
>>>> Apache Sling Thread Dumper ........................ SKIPPED
>>>> Apache Sling Web Console Branding ................. SKIPPED
>>>> Apache Sling Web Console Security Provider ........ SKIPPED
>>>> Apache Sling Groovy Extensions .................... SKIPPED
>>>> Apache Sling Explorer ............................. SKIPPED
>>>> Apache Sling Health Check Core .................... SKIPPED
>>>> Apache Sling Health Check Samples ................. SKIPPED
>>>> Apache Sling Health Check Support Components ...... SKIPPED
>>>> Apache Sling Health Check MBeans .................. SKIPPED
>>>> Apache Sling Health Check Webconsole Plugin ....... SKIPPED
>>>> Apache Sling Health Check Integration Tests ....... SKIPPED
>>>> Apache Sling Health Check Reactor POM ............. SKIPPED
>>>> Apache Sling Test Tools ........................... SKIPPED
>>>> Apache Sling JUnit Core ........................... SKIPPED
>>>> Apache Sling JUnit Scriptable Tests Provider ...... SKIPPED
>>>> Apache Sling JUnit Health Checks .................. SKIPPED
>>>> Apache Sling JUnit Remote Tests Runners ........... SKIPPED
>>>> Apache Sling Testing Resource Resolver Mock ....... SKIPPED
>>>> Apache Sling Installer ............................ SKIPPED
>>>> Apache Sling Installer WebConsole Plugin .......... SKIPPED
>>>> Apache Sling File Installer ....................... SKIPPED
>>>> Apache Sling JCR Installer ........................ SKIPPED
>>>> Apache Sling Installer Configuration Admin Support SKIPPED
>>>> Apache Sling Deployment Package Installer ......... SKIPPED
>>>> Apache Sling Installer Integration Tests .......... SKIPPED
>>>> Apache Sling Launchpad API ........................ SKIPPED
>>>> Apache Sling Launchpad Base ....................... SKIPPED
>>>> Apache Sling Launchpad Installer .................. SKIPPED
>>>> Apache Sling Launchpad Content .................... SKIPPED
>>>> Apache Sling Launchpad Application Builder ........ SKIPPED
>>>> Apache Sling Sample Server-Side Tests ............. SKIPPED
>>>> Apache Sling Failing Server-Side Tests ............ SKIPPED
>>>> Apache Sling Sample Integration Tests ............. SKIPPED
>>>> Apache Sling Commons Java Compiler ................ SKIPPED
>>>> Apache Sling Commons FileSystem ClassLoader ....... SKIPPED
>>>> Apache Sling Commons HTML Utilities ............... SKIPPED
>>>> Apache Sling APT parser ........................... SKIPPED
>>>> Apache Sling APT servlet .......................... SKIPPED
>>>> Apache Sling Resource Collection API .............. SKIPPED
>>>> Apache Sling Dojo JavaScript Library .............. SKIPPED
>>>> Apache Sling Dojo Data Extension .................. SKIPPED
>>>> Apache Sling FTP Server ........................... SKIPPED
>>>> Apache Sling Google Web Toolkit Servlet Library ... SKIPPED
>>>> Apache Sling Google Web Toolkit Sample ............ SKIPPED
>>>> Apache Sling Internationalization Support ......... SKIPPED
>>>> Apache Sling JMX Resource Provider ................ SKIPPED
>>>> Apache Sling MongoDB Resource Provider ............ SKIPPED
>>>> Apache Sling OSGi Bundle Repository ............... SKIPPED
>>>> Apache Sling Request Processing Analyzer .......... SKIPPED
>>>> Apache Sling Rewriter ............................. SKIPPED
>>>> Apache Sling Tenant ............................... SKIPPED
>>>> Apache Sling Repository Accessor .................. SKIPPED
>>>> Apache Sling JCR Java Compiler .................... SKIPPED
>>>> Apache Sling JCR Prefs ............................ SKIPPED
>>>> Apache Sling Launchpad Karaf ...................... SKIPPED
>>>> Apache Sling Launchpad Karaf - Features ........... SKIPPED
>>>> Apache Sling Launchpad Karaf - Integration Tests .. SKIPPED
>>>> Apache Sling Launchpad Karaf Builder .............. SKIPPED
>>>> Apache Sling Scripting Python Support ............. SKIPPED
>>>> Apache Sling Scripting W3C XML Processing Support . SKIPPED
>>>> Apache Sling Launchpad Contrib Testing ............ SKIPPED
>>>> Apache Sling Script Console ....................... SKIPPED
>>>> Apache Sling Atom Tag Library ..................... SKIPPED
>>>> Apache Sling Scripting Freemarker Support ......... SKIPPED
>>>> Apache Sling Scripting Java Support ............... SKIPPED
>>>> Apache Sling Scripting JST Support ................ SKIPPED
>>>> Apache Sling Scripting Ruby Support ............... SKIPPED
>>>> Apache Sling Scripting Velocity Support ........... SKIPPED
>>>> Apache Sling Contrib (Builder) .................... SKIPPED
>>>> Apache Sling (Builder) ............................ SKIPPED
>>>> ------------------------------------------------------------------------
>>>> BUILD FAILURE
>>>> ------------------------------------------------------------------------
>>>> Total time: 17:16.209s
>>>> Finished at: Thu Oct 17 00:19:36 CDT 2013
>>>> Final Memory: 115M/354M
>>>> ------------------------------------------------------------------------
>>>> Failed to execute goal
>>> org.apache.maven.plugins:maven-failsafe-plugin:2.12.4:verify (default) on
>>> project org.apache.sling.event: There are test failures.
>>>>
>>>> Please refer to
>>> /home/daddy/Code/OPEN_SOURCE/apache/sling/trunk/bundles/extensions/event/target/failsafe-reports
>>> for the individual test results.
>>>> -> [Help 1]
>>>>
>>>> To see the full stack trace of the errors, re-run Maven with the -e
>>> switch.
>>>> Re-run Maven using the -X switch to enable full debug logging.
>>>>
>>>> For more information about the errors and possible solutions, please
>>> read the following articles:
>>>> [Help 1]
>>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>>>>
>>>> After correcting the problems, you can resume the build with the command
>>>> mvn <goals> -rf :org.apache.sling.event
>>>>
>>>
>>>
>>
>>
>> --
>> Carsten Ziegeler
>> [email protected]
>>
>
>
>
> --
> Carsten Ziegeler
> [email protected]