diff --git a/.travis/before_install.sh b/.travis/before_install.sh index 4b0182f2cf..c0f9c55853 100644 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -19,22 +19,22 @@ if travis_isLinux; then bundle config set --local with release_notes_preprocessing bundle install - # install jdk7 for integration test - LOCAL_DIR=${HOME}/.cache/jdk7 - TARGET_DIR=${HOME}/oraclejdk7 - JDK7_ARCHIVE=jdk-7u80-linux-x64.tar.gz - DOWNLOAD_URL=https://pmd-code.org/oraclejdk/${JDK7_ARCHIVE} + # install openjdk8 for integration test + LOCAL_DIR=${HOME}/.cache/jdk8 + TARGET_DIR=${HOME}/openjdk8 + OPENJDK8_ARCHIVE=OpenJDK8U-jdk_x64_linux_hotspot_8u265b01.tar.gz + DOWNLOAD_URL=https://pmd-code.org/openjdk/jdk-8u265b01/${OPENJDK8_ARCHIVE} mkdir -p ${LOCAL_DIR} mkdir -p ${TARGET_DIR} - if [ ! -e ${LOCAL_DIR}/${JDK7_ARCHIVE} ]; then + if [ ! -e ${LOCAL_DIR}/${OPENJDK8_ARCHIVE} ]; then log_info "Downloading from ${DOWNLOAD_URL} to ${LOCAL_DIR}" wget --directory-prefix ${LOCAL_DIR} --timestamping --continue ${DOWNLOAD_URL} else - log_info "Skipped download, file ${LOCAL_DIR}/${JDK7_ARCHIVE} already exists" + log_info "Skipped download, file ${LOCAL_DIR}/${OPENJDK8_ARCHIVE} already exists" fi log_info "Extracting to ${TARGET_DIR}" - tar --extract --file ${LOCAL_DIR}/${JDK7_ARCHIVE} -C ${TARGET_DIR} --strip-components=1 - log_info "OracleJDK7 can be used via -Djava7.home=${TARGET_DIR}" + tar --extract --file ${LOCAL_DIR}/${OPENJDK8_ARCHIVE} -C ${TARGET_DIR} --strip-components=1 + log_info "OpenJDK8 can be used via -Djava8.home=${TARGET_DIR}" else log_info "Not setting up ruby for ${TRAVIS_OS_NAME}." diff --git a/.travis/build-deploy.sh b/.travis/build-deploy.sh index e9250ad7c4..41c98a7278 100755 --- a/.travis/build-deploy.sh +++ b/.travis/build-deploy.sh @@ -11,7 +11,7 @@ VERSION=$(get_pom_version) log_info "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}" if travis_isLinux; then - MVN_BUILD_FLAGS="-B -V -Djava7.home=${HOME}/oraclejdk7" + MVN_BUILD_FLAGS="-B -V -Djava8.home=${HOME}/openjdk8" else MVN_BUILD_FLAGS="-B -V" fi diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 5c2f0420b4..89038c57e5 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -259,11 +259,10 @@ - - jdk7-compat-it + jdk8-compat-it - java7.home + java8.home @@ -273,15 +272,15 @@ maven-failsafe-plugin - jdk7-compat-it + jdk8-compat-it integration-test verify - ${java7.home} - ${java7.home}/bin:${env.PATH} + ${java8.home} + ${java8.home}/bin:${env.PATH} diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java index 9249c3ca3b..823e304a04 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java @@ -21,11 +21,6 @@ public class AllRulesIT extends AbstractBinaryDistributionTest { @Parameters public static Iterable languagesToTest() { - if (PMDExecutor.isJava7Test()) { - // note: apex and scala require java8 - return Arrays.asList("java", "javascript", "jsp", "modelica", - "plsql", "pom", "visualforce", "velocitytemplate", "xml", "xsl"); - } // note: scala and wsdl have no rules return Arrays.asList("java", "apex", "javascript", "jsp", "modelica", "plsql", "pom", "visualforce", "velocitytemplate", "xml", "xsl"); diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index a2f0203558..2bde16fa8a 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -25,14 +25,8 @@ public class BinaryDistributionIT extends AbstractBinaryDistributionTest { private static final String SUPPORTED_LANGUAGES_PMD; static { - // note: apex and scala require java8 - if (PMDExecutor.isJava7Test()) { - SUPPORTED_LANGUAGES_CPD = "Supported languages: [cpp, cs, dart, ecmascript, fortran, go, groovy, java, jsp, kotlin, lua, matlab, modelica, objectivec, perl, php, plsql, python, ruby, swift, vf, xml]"; - SUPPORTED_LANGUAGES_PMD = "ecmascript, java, jsp, modelica, plsql, pom, vf, vm, wsdl, xml, xsl"; - } else { - SUPPORTED_LANGUAGES_CPD = "Supported languages: [apex, cpp, cs, dart, ecmascript, fortran, go, groovy, java, jsp, kotlin, lua, matlab, modelica, objectivec, perl, php, plsql, python, ruby, scala, swift, vf, xml]"; - SUPPORTED_LANGUAGES_PMD = "apex, ecmascript, java, jsp, modelica, plsql, pom, scala, swift, vf, vm, wsdl, xml, xsl"; - } + SUPPORTED_LANGUAGES_CPD = "Supported languages: [apex, cpp, cs, dart, ecmascript, fortran, go, groovy, java, jsp, kotlin, lua, matlab, modelica, objectivec, perl, php, plsql, python, ruby, scala, swift, vf, xml]"; + SUPPORTED_LANGUAGES_PMD = "apex, ecmascript, java, jsp, modelica, plsql, pom, scala, swift, vf, vm, wsdl, xml, xsl"; } @Test diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java index fab4350ea6..c2f9504320 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java @@ -14,7 +14,6 @@ import java.util.List; import java.util.concurrent.TimeUnit; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.SystemUtils; import net.sourceforge.pmd.PMDVersion; @@ -134,8 +133,4 @@ public class PMDExecutor { return runPMDUnix(tempDir, null, arguments); } } - - public static boolean isJava7Test() { - return StringUtils.equals(System.getenv("JAVA_HOME"), System.getProperty("java7.home")); - } }