diff --git a/build.gradle b/build.gradle index c9194934cbb..cf94815bfb3 100644 --- a/build.gradle +++ b/build.gradle @@ -3,17 +3,13 @@ buildscript { maven { url "https://repo.spring.io/plugins-release" } } dependencies { - classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7") - classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2") + classpath("io.spring.gradle:propdeps-plugin:0.0.9.RELEASE") classpath("io.spring.gradle:docbook-reference-plugin:0.3.1") + classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2") classpath("ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1") } } -plugins { - id "org.sonarqube" version "1.1" -} - ext { linkHomepage = 'https://projects.spring.io/spring-framework' linkCi = 'https://build.spring.io/browse/SPR' @@ -222,12 +218,6 @@ configure(subprojects - project(":spring-build-src")) { subproject -> jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime") } - gradle.taskGraph.whenReady {taskGraph -> - if (taskGraph.hasTask(':sonarqube')) { - test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*" - } - } - jar { manifest.attributes["Created-By"] = "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})" @@ -1134,20 +1124,6 @@ project("spring-framework-bom") { } } -sonarqube { - properties { - property "sonar.projectName", "Spring Framework" - property "sonar.profile", "Spring Framework" - property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec" - property "sonar.links.homepage", linkHomepage - property "sonar.links.ci", linkCi - property "sonar.links.issue", linkIssue - property "sonar.links.scm", linkScmUrl - property "sonar.links.scm_dev", linkScmDevConnection - property "sonar.java.coveragePlugin", "jacoco" - } -} - configure(rootProject) { description = "Spring Framework" @@ -1370,9 +1346,9 @@ configure(rootProject) { archives distZip } - task wrapper(type: Wrapper) { + wrapper { description = "Generates gradlew[.bat] scripts" - gradleVersion = "2.14.1" + gradleVersion = "4.10.2" doLast() { def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m" @@ -1388,21 +1364,6 @@ configure(rootProject) { } -configure([project(':spring-build-src'), project(':spring-framework-bom')]) { - sonarqube { - skipProject = true - } -} - -configure(project(':spring-core')) { - sonarqube { - properties { - property "sonar.exclusions", - "src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*" - } - } -} - /* * Support publication of artifacts versioned by topic branch. * CI builds supply `-P BRANCH_NAME=` to gradle at build time. diff --git a/gradle/ide.gradle b/gradle/ide.gradle index 10ee361e73a..9644f57cf0b 100644 --- a/gradle/ide.gradle +++ b/gradle/ide.gradle @@ -21,7 +21,7 @@ eclipse.classpath.file.whenMerged { classpath -> def projectName = matcher[0][1] def path = "/${projectName}" if(!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) { - def dependency = new ProjectDependency(path, project(":${projectName}").path) + def dependency = new ProjectDependency(path) dependency.exported = true classpath.entries.add(dependency) } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 3baa851b28c..29953ea141f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 19e5389604f..e0b3fb8d70b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Aug 17 21:21:18 CEST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip diff --git a/gradlew b/gradlew index 11c2301b88a..e1f51d4d9f3 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -34,11 +34,11 @@ DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -155,11 +155,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index d65bbb5b916..0106f16e1e4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -50,7 +50,6 @@ goto fail @rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -61,11 +60,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/spring-context/src/test/resources/org/springframework/scripting/groovy/ScriptBean.groovy b/spring-context/src/test/resources/org/springframework/scripting/groovy/ScriptBean.groovy index a6b437ef687..ed4c2e6da5f 100644 --- a/spring-context/src/test/resources/org/springframework/scripting/groovy/ScriptBean.groovy +++ b/spring-context/src/test/resources/org/springframework/scripting/groovy/ScriptBean.groovy @@ -1,3 +1,5 @@ +package org.springframework.scripting.groovy; + import org.springframework.context.ApplicationContext import org.springframework.context.ApplicationContextAware import org.springframework.scripting.ContextScriptBean diff --git a/spring-context/src/test/resources/org/springframework/scripting/groovy/TestFactoryBean.groovy b/spring-context/src/test/resources/org/springframework/scripting/groovy/TestFactoryBean.groovy index e86c13a6efb..08635b776c7 100644 --- a/spring-context/src/test/resources/org/springframework/scripting/groovy/TestFactoryBean.groovy +++ b/spring-context/src/test/resources/org/springframework/scripting/groovy/TestFactoryBean.groovy @@ -1,3 +1,5 @@ +package org.springframework.scripting.groovy; + import org.springframework.beans.factory.FactoryBean class TestFactoryBean implements FactoryBean { diff --git a/spring-context/src/test/resources/org/springframework/scripting/groovy/simple.groovy b/spring-context/src/test/resources/org/springframework/scripting/groovy/simple.groovy index 1bb7d85d79f..b999147fe63 100644 --- a/spring-context/src/test/resources/org/springframework/scripting/groovy/simple.groovy +++ b/spring-context/src/test/resources/org/springframework/scripting/groovy/simple.groovy @@ -1 +1,3 @@ +package org.springframework.scripting.groovy; + return 3 * 2 diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityToolboxView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityToolboxView.java index 2776f6eb60f..842efcfd984 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityToolboxView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityToolboxView.java @@ -23,9 +23,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.velocity.VelocityContext; import org.apache.velocity.context.Context; -import org.apache.velocity.tools.view.ToolboxManager; -import org.apache.velocity.tools.view.context.ChainedContext; -import org.apache.velocity.tools.view.servlet.ServletToolboxManager; import org.springframework.util.ClassUtils; import org.springframework.util.ReflectionUtils; @@ -99,18 +96,21 @@ public class VelocityToolboxView extends VelocityView { * @see #initTool */ @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) protected Context createVelocityContext( Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { // Create a ChainedContext instance. - ChainedContext velocityContext = new ChainedContext( - new VelocityContext(model), getVelocityEngine(), request, response, getServletContext()); + org.apache.velocity.tools.view.context.ChainedContext velocityContext = + new org.apache.velocity.tools.view.context.ChainedContext( + new VelocityContext(model), getVelocityEngine(), request, response, getServletContext()); // Load a Velocity Tools toolbox, if necessary. if (getToolboxConfigLocation() != null) { - ToolboxManager toolboxManager = ServletToolboxManager.getInstance( - getServletContext(), getToolboxConfigLocation()); - Map toolboxContext = toolboxManager.getToolbox(velocityContext); + org.apache.velocity.tools.view.ToolboxManager toolboxManager = + org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance( + getServletContext(), getToolboxConfigLocation()); + Map toolboxContext = toolboxManager.getToolbox(velocityContext); velocityContext.setToolbox(toolboxContext); }