diff --git a/.gitignore b/.gitignore index 89216b36..ac7bd0b5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ target/ *.iml .idea *.orig -.springBeans \ No newline at end of file +.springBeans +credentials.yml diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 00000000..9cc84ea9 Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 00000000..c3150437 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 58290503..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: java -jdk: - - oraclejdk8 -env: - matrix: - - PROFILE=non-existant - - PROFILE=spring43-next - - PROFILE=spring5 - - PROFILE=spring5-next - - PROFILE=spring51 - - PROFILE=spring51-next -addons: - apt: - packages: - - oracle-java8-installer -cache: - directories: - - $HOME/.m2 -sudo: false -install: true -script: "mvn clean dependency:list test -P${PROFILE} -Dsort" diff --git a/ci/README.adoc b/ci/README.adoc new file mode 100644 index 00000000..a8d9d2b8 --- /dev/null +++ b/ci/README.adoc @@ -0,0 +1,38 @@ +== Spring HATEOAS CI + +Spring HATEOAS uses Concourse as it's CI tool of choice. This provides support for: + +* Pipeline against the `master` branch +* Support for pull requests + +=== Creating a pipeline + +Using the `fly` command, you can execute a series of commands to create multiple pipelines to manage everything. But +first, some critical credentials are needed. + +Create a `credentials.yml` file like this: + +[source,yml] +---- +github-access-token: +docker-email: +docker-username: +docker-password: +artifactory-username: +artifactory-password: +---- + +WARNING: Do NOT check this file into source control! If you'll check, `credentials.yml` is listed in `.gitignore` to prevent this. + +With this in place, run the following `fly` commands to create pipelines: + +---- +% fly -t spring-data sp -p spring-hateoas -c ci/pipeline-template.yml -l credentials.yml -v branch=master +---- + +With this pipeline in place, you can now activate and expose it: + +---- +% fly -t spring-data unpause-pipeline -p spring-hateoas +% fly -t spring-data expose-pipeline -p spring-hateoas +---- \ No newline at end of file diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 00000000..a40cd2f0 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euo pipefail + +[[ -d $PWD/maven && ! -d $HOME/.m2 ]] && ln -s $PWD/maven $HOME/.m2 + +spring_hateoas_artifactory=$(pwd)/spring-hateoas-artifactory + +rm -rf $HOME/.m2/repository/org/springframework/hateoas 2> /dev/null || : + +cd spring-hateoas-github + +./mvnw -Pdistribute -Dmaven.test.skip=true clean deploy \ + -DaltDeploymentRepository=distribution::default::file://${spring_hateoas_artifactory} diff --git a/ci/build.yml b/ci/build.yml new file mode 100644 index 00000000..124d2d35 --- /dev/null +++ b/ci/build.yml @@ -0,0 +1,20 @@ +--- +platform: linux + +image_resource: + type: docker-image + source: + repository: openjdk + tag: 8-jdk + +inputs: +- name: spring-hateoas-github + +outputs: +- name: spring-hateoas-artifactory + +caches: +- path: maven + +run: + path: spring-hateoas-github/ci/build.sh diff --git a/ci/pipeline-template.yml b/ci/pipeline-template.yml new file mode 100644 index 00000000..43d69970 --- /dev/null +++ b/ci/pipeline-template.yml @@ -0,0 +1,235 @@ +--- +resource_types: +- name: artifactory-resource + type: docker-image + source: + repository: springio/artifactory-resource + tag: 0.0.6 + +- name: github-status + type: docker-image + source: + repository: dpb587/github-status-resource + tag: master + +- name: pull-request + type: docker-image + source: + repository: jtarchie/pr + tag: latest + +- name: slack-notification + type: docker-image + source: + repository: nebhale/slack-notification-resource + +resources: +- name: openjdk:8-jdk + type: docker-image + source: + repository: openjdk + tag: 8-jdk + +- name: spring-hateoas-github + type: git + source: + uri: https://github.com/spring-projects/spring-hateoas.git + branch: ((branch)) + +- name: spring-hateoas-artifactory + type: artifactory-resource + source: + uri: https://repo.spring.io + username: ((artifactory-username)) + password: ((artifactory-password)) + build_name: spring-hateoas + +- name: spring-hateoas-pull-requests + type: pull-request + source: + access_token: ((github-access-token)) + repo: spring-projects/spring-hateoas + base: ((branch)) + +- name: spring-hateoas-status + type: github-status + source: + access_token: ((github-access-token)) + repository: spring-projects/spring-hateoas + branch: ((branch)) + +- name: slack + type: slack-notification + source: + url: ((slack)) + +groups: +- name: spring-hateoas + jobs: + - Test - JDK 8 + - Test - JDK 8 and Spring 5.0 (snapshots) + - Test - JDK 8 and Spring 5.1 (snapshots) + - Build +- name: pull-requests + jobs: + - spring-hateoas-pull-requests + +jobs: +- name: Test - JDK 8 + serial: true + public: true + plan: + - get: spring-hateoas-github + trigger: true + - get: openjdk:8-jdk + trigger: true + - task: test + file: spring-hateoas-github/ci/test.yml + params: { PROFILE: "non-existent" } + <<: *slack-failure + +- name: Test - JDK 8 and Spring 5.0 (snapshots) + serial: true + public: true + plan: + - get: spring-hateoas-github + trigger: true + - get: openjdk:8-jdk + trigger: true + - task: test + file: spring-hateoas-github/ci/test.yml + params: { PROFILE: "spring5-next" } + <<: *slack-failure + +- name: Test - JDK 8 and Spring 5.1 (snapshots) + serial: true + public: true + plan: + - get: spring-hateoas-github + trigger: true + - get: openjdk:8-jdk + trigger: true + - task: test + file: spring-hateoas-github/ci/test.yml + params: { PROFILE: "spring51-next" } + <<: *slack-failure + +- name: Build + serial: true + public: true + plan: + - get: spring-hateoas-github + trigger: true + passed: [ + Test - JDK 8, + Test - JDK 8 and Spring 5.0 (snapshots), + Test - JDK 8 and Spring 5.1 (snapshots) + ] + - put: spring-hateoas-status + params: + commit: spring-hateoas-github + state: pending + - task: build + file: spring-hateoas-github/ci/build.yml + - put: spring-hateoas-artifactory + params: + build_number: ${BUILD_NAME} + build_uri: ${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME} + repo: libs-snapshot-local + folder: spring-hateoas-artifactory + artifact_set: + - include: + - "/**" + properties: + archives: '*:*:*:*@zip zip.name:spring-hateoas, zip.displayname:Spring HATEOAS, zip.deployed:false' + on_failure: + aggregate: + - put: spring-hateoas-status + params: + commit: spring-hateoas-github + state: failure + - put: slack + params: + attachments: + - color: danger + fallback: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME " + text: "Build has failed" + title: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME" + title_link: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME + on_success: + aggregate: + - put: spring-hateoas-status + params: + commit: spring-hateoas-github + state: success + - put: slack + params: + attachments: + - color: good + fallback: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME " + text: "Build has succeeded!" + title: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME" + title_link: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME + +- name: spring-hateoas-pull-requests + public: true + plan: + - get: spring-hateoas-github + resource: spring-hateoas-pull-requests + trigger: true + version: every + - put: spring-hateoas-pull-requests + params: + path: spring-hateoas-github + status: pending + - aggregate: + - task: test (JDK 8) + file: spring-hateoas-github/ci/test.yml + params: { PROFILE: "non-existent" } + - task: test (JDK 8 and Spring 5.0 snapshots) + file: spring-hateoas-github/ci/test.yml + params: { PROFILE: "spring5-next" } + - task: test (JDK 8 and Spring 5.1 snapshots) + file: spring-hateoas-github/ci/test.yml + params: { PROFILE: "spring51-next" } + on_failure: + aggregate: + - put: spring-hateoas-pull-requests + params: + path: spring-hateoas-github + status: failure + - put: slack + params: + attachments: + - color: danger + fallback: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME " + text: "Pull request has failed" + title: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME" + title_link: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME + on_success: + aggregate: + - put: spring-hateoas-pull-requests + params: + path: spring-hateoas-github + status: success + - put: slack + params: + attachments: + - color: good + fallback: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME " + text: "Pull request has succeeded!" + title: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME" + title_link: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME + +slack-failure: &slack-failure + on_failure: + put: slack + params: + attachments: + - color: danger + fallback: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME " + text: "Test has failed" + title: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME" + title_link: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME + + diff --git a/ci/test.sh b/ci/test.sh new file mode 100755 index 00000000..570e22ce --- /dev/null +++ b/ci/test.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euo pipefail + +[[ -d $PWD/maven && ! -d $HOME/.m2 ]] && ln -s $PWD/maven $HOME/.m2 + +rm -rf $HOME/.m2/repository/org/springframework/hateoas 2> /dev/null || : + +cd spring-hateoas-github + +./mvnw clean dependency:list test -P${PROFILE} -Dsort diff --git a/ci/test.yml b/ci/test.yml new file mode 100644 index 00000000..b465b3a0 --- /dev/null +++ b/ci/test.yml @@ -0,0 +1,17 @@ +--- +platform: linux + +image_resource: + type: docker-image + source: + repository: openjdk + tag: 8-jdk + +inputs: +- name: spring-hateoas-github + +caches: +- path: maven + +run: + path: spring-hateoas-github/ci/test.sh diff --git a/mvnw b/mvnw new file mode 100755 index 00000000..5bf251c0 --- /dev/null +++ b/mvnw @@ -0,0 +1,225 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Migwn, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +echo $MAVEN_PROJECTBASEDIR +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 00000000..019bd74d --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,143 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" + +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml index a6538277..b0a98007 100644 --- a/pom.xml +++ b/pom.xml @@ -380,10 +380,47 @@ + + package-and-attach-docs-zip + package + + run + + + + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + attach-zip + + attach-artifact + + + + + ${project.build.directory}/${project.artifactId}-${project.version}.zip + zip + + + + + + + org.apache.maven.plugins maven-assembly-plugin @@ -406,32 +443,6 @@ - - org.codehaus.mojo - wagon-maven-plugin - 1.0 - - ${project.build.directory} - - - - upload-static-resources - deploy - - upload - - - ${project.build.directory}/static-resources - ** - static-dot-s2 - scp://docs.af.pivotal.io - /var/www/domains/spring.io/www/htdocs/autorepo/docs/${project.artifactId}/${project.version} - true - - - - - @@ -635,7 +646,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.7.0 + 3.8.0 ${source.level} ${source.level} @@ -694,21 +705,35 @@ ${source.level} true -Xdoclint:none - ${shared.resources}/javadoc/spring-javadoc.css + ${basedir}/src/main/javadoc/spring-javadoc.css http://static.springframework.org/spring/docs/4.3.x/javadoc-api http://docs.oracle.com/javase/6/docs/api + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + false + org.apache.maven.plugins maven-deploy-plugin 2.8.2 - - true -