Author: rombert Date: Fri Sep 1 09:43:04 2017 New Revision: 1806917 URL: http://svn.apache.org/viewvc?rev=1806917&view=rev Log: SLING-7072 - Build failure with Java 9 - unable to create javax script engine for javascript
Replace the maven-antrun-plugin snippet with the javaversion-maven-plugin in the parent pom. Modified: sling/trunk/parent/pom.xml Modified: sling/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/parent/pom.xml?rev=1806917&r1=1806916&r2=1806917&view=diff ============================================================================== --- sling/trunk/parent/pom.xml (original) +++ sling/trunk/parent/pom.xml Fri Sep 1 09:43:04 2017 @@ -111,7 +111,18 @@ <build> <plugins> - + <plugin> + <groupId>org.apache.sling</groupId> + <artifactId>javaversion-maven-plugin</artifactId> + <version>1.0.0</version> + <executions> + <execution> + <goals> + <goal>set-java-version</goal> + </goals> + </execution> + </executions> + </plugin> <!-- Require Java 7 or higher for building (as bnd since version 3.0 is built with Java 7) --> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -173,47 +184,7 @@ </plugin> <!-- warn for SLING-443/SLING-1782 --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <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 = "JavaSE-1.6"; - var animalSnifferSignaturesVersion = "6"; - var slingJavaVersion = System.getProperty("sling.java.version"); - if (!slingJavaVersion) { - slingJavaVersion = project.getProperty("sling.java.version"); - } - if (slingJavaVersion == "7") { - animalSnifferSignaturesVersion = "7"; - bree = "JavaSE-1.7"; - System.out.println("Setting Bundle-RequiredExecutionEnvironment=" + bree + " from sling.java.version=" + slingJavaVersion); - } else if ( slingJavaVersion == "8") { - animalSnifferSignaturesVersion = "8"; - bree = "JavaSE-1.8"; - System.out.println("Setting Bundle-RequiredExecutionEnvironment=" + bree + " from sling.java.version=" + slingJavaVersion); - } else if (slingJavaVersion != "6") { - System.out.println("Unsupported sling.java.version=" + slingJavaVersion + "; must be 6, 7 or 8."); - throw "sling.java.version must be 6, 7 or 8"; - } - project.setProperty("sling.bree", bree); - project.setProperty("sling.animalSignatures.version", animalSnifferSignaturesVersion); - ]]></script> - </target> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.codehaus.mojo</groupId> @@ -703,25 +674,6 @@ <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> - <pluginExecutionFilter> - <groupId> - org.apache.maven.plugins - </groupId> - <artifactId> - maven-antrun-plugin - </artifactId> - <versionRange> - [1.3,) - </versionRange> - <goals> - <goal>run</goal> - </goals> - </pluginExecutionFilter> - <action> - <ignore /> - </action> - </pluginExecution> - <pluginExecution> <pluginExecutionFilter> <groupId> org.apache.maven.plugins