diff --git a/.travis.yml b/.travis.yml index 09eb38fa..aeea0607 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,10 @@ language: groovy jdk: - openjdk11 -sudo: false branches: only: - master - develop - - /^feature\/.*$/ - - /^bugfix\/.*$/ - before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ @@ -19,6 +15,10 @@ cache: - $HOME/.gradle/caches/ - $HOME/.gradle/wrapper/ +install: + - 'travis_wait 30 ./gradlew clean' + - './gradlew assemble' + after_success: - './gradlew bootJar' - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && travis_retry ./gradlew publish' @@ -27,4 +27,4 @@ env: global: - JAVA_TOOL_OPTIONS=-Dhttps.protocols=TLSv1.2 - secure: G31IscTcNtjjFA0R2pDRaZ2Std1d5F3pIfr3NUe0PsKcj8F2ubFd6xZ3LCccKu/HdDdlJ/6K6Khn1EfwHie5NRP+Uu7oAUOVkTXSeI4KfQFywpf3TvKLILh8/2NUe0451ESivKQ28UW4jPOehmLtCyd7MbxnO9GIrYyaWjNEJJw= - - secure: g7txXzs6g/DzF9bwI5UZ4wG2QxB4aqQeAK1TxL3P0DfMHB8hXs/BydKrFaA9TnJiB/g0fwabNCuJWr+IgOL3EPA1txwVu9VVttHqKiJXthoen1eN0QJtsCWhlE2/ldC1mENaJVXBQs7++sNutytUIOr9m2Yk78mXnu2RIfk7U/k= \ No newline at end of file + - secure: g7txXzs6g/DzF9bwI5UZ4wG2QxB4aqQeAK1TxL3P0DfMHB8hXs/BydKrFaA9TnJiB/g0fwabNCuJWr+IgOL3EPA1txwVu9VVttHqKiJXthoen1eN0QJtsCWhlE2/ldC1mENaJVXBQs7++sNutytUIOr9m2Yk78mXnu2RIfk7U/k= diff --git a/build.gradle b/build.gradle index bda19662..e6ebcfeb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,35 +1,22 @@ -buildscript { - repositories { - mavenLocal() - maven { url "https://nexus.ala.org.au/content/groups/public/" } - maven { url "https://repo.grails.org/grails/core" } - } - dependencies { - classpath "org.grails:grails-gradle-plugin:$grailsVersion" - classpath "org.grails.plugins:hibernate5:${gormVersion}" - classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.4.6" - classpath 'org.grails.plugins:database-migration:4.2.0' - } -} - plugins { + id "groovy" + id "org.grails.grails-gsp" + id "org.grails.grails-web" + id "com.github.erdi.webdriver-binaries" version "3.0" + id "war" + id "idea" + id "com.bertramlabs.asset-pipeline" + id "application" + id "eclipse" + id "com.gorylenko.gradle-git-properties" version "2.4.1" + + id "maven-publish" } -version "4.1.0-SNAPSHOT" +version "5.0.0-SNAPSHOT" group "au.org.ala" -apply plugin:"eclipse" -apply plugin:"idea" -apply plugin:"war" -apply plugin:"org.grails.grails-web" -apply plugin:"com.github.erdi.webdriver-binaries" -apply plugin:"com.bertramlabs.asset-pipeline" -apply plugin:"org.grails.grails-gsp" -apply plugin:"maven-publish" - - publishing { targetCompatibility = 1.11 repositories { @@ -51,12 +38,22 @@ publishing { bootWar { launchScript() + dependsOn(compileGroovyPages) +} + +war { + dependsOn(compileGroovyPages) +} + +java { + sourceCompatibility = JavaVersion.toVersion("11") } repositories { mavenLocal() maven { url "https://nexus.ala.org.au/content/groups/public/" } - maven { url "https://repo.grails.org/grails/core" } + mavenCentral() + maven { url "https://repo.grails.org/grails/core/" } } configurations { @@ -94,7 +91,7 @@ dependencies { implementation "org.grails.plugins:scaffolding" implementation "org.grails.plugins:events" implementation "org.grails.plugins:hibernate5" - implementation "org.hibernate:hibernate-core:5.4.18.Final" + implementation("org.hibernate:hibernate-core:5.6.15.Final") implementation "org.grails.plugins:gsp" implementation "com.opencsv:opencsv:3.7" @@ -106,8 +103,8 @@ dependencies { // See: https://github.com/AtlasOfLivingAustralia/collectory/issues/84#issuecomment-1070670979 // before updating mysql-connector-java - implementation "mysql:mysql-connector-java:8.0.22" - implementation "org.grails.plugins:ala-bootstrap3:4.3.0" + implementation 'mysql:mysql-connector-java:8.0.33' + implementation "org.grails.plugins:ala-bootstrap3:4.4.0" implementation "au.org.ala.plugins.grails:ala-charts-plugin:2.3.0" implementation "org.grails.plugins:ala-auth:$alaSecurityLibsVersion" implementation "org.grails.plugins:ala-ws-security-plugin:$alaSecurityLibsVersion" @@ -123,23 +120,23 @@ dependencies { runtimeOnly "com.h2database:h2" runtimeOnly "org.apache.tomcat:tomcat-jdbc" runtimeOnly "javax.xml.bind:jaxb-api:2.3.1" - runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:3.4.6" + runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:4.3.0" testImplementation "io.micronaut:micronaut-inject-groovy" testImplementation "org.grails:grails-gorm-testing-support" testImplementation "org.mockito:mockito-core" testImplementation "org.grails:grails-web-testing-support" - testImplementation "org.grails.plugins:geb" - testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion" - testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion" - testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion" - runtimeOnly "net.sourceforge.htmlunit:htmlunit:2.18" - testImplementation "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1" - testImplementation "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" - testImplementation "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" - testImplementation "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion" +// testImplementation "org.grails.plugins:geb" +// testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion" +// testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion" +// testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion" +// runtimeOnly "net.sourceforge.htmlunit:htmlunit:2.18" +// testImplementation "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1" +// testImplementation "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" +// testImplementation "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" +// testImplementation "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion" implementation 'org.grails.plugins:sentry:11.7.25' // db-migration - implementation 'org.liquibase:liquibase-core:4.19.0' + implementation 'org.liquibase:liquibase-core:4.20.0' implementation('org.grails.plugins:database-migration:4.2.0') { // spring-boot-cli exclusion required since Grails5 upgrade to prevent NullPointerException Error: https://github.com/grails/grails-database-migration/issues/268 exclude module: 'spring-boot-cli' @@ -157,18 +154,18 @@ bootRun { String springProfilesActive = 'spring.profiles.active' systemProperty springProfilesActive, System.getProperty(springProfilesActive) } - -tasks.withType(Test) { - systemProperty "geb.env", System.getProperty('geb.env') - systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest") - systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver') - systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver') -} - -webdriverBinaries { - chromedriver "$chromeDriverVersion" - geckodriver "$geckodriverVersion" -} +// +//tasks.withType(Test) { +// systemProperty "geb.env", System.getProperty('geb.env') +// systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest") +// systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver') +// systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver') +//} +// +//webdriverBinaries { +// chromedriver "$chromeDriverVersion" +// geckodriver "$geckodriverVersion" +//} assets { minifyJs = true diff --git a/gradle.properties b/gradle.properties index d92011b4..2e1fd502 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,7 @@ -grailsVersion=5.2.1 +grailsVersion=6.0.0 +grailsGradlePluginVersion=6.0.0 gormVersion=7.2.1 +org.gradle.caching=true org.gradle.daemon=true org.gradle.parallel=true org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M @@ -10,4 +12,4 @@ webdriverBinariesVersion=2.6 chromeDriverVersion=2.45.0 geckodriverVersion=0.24.0 seleniumSafariDriverVersion=3.14.0 -alaSecurityLibsVersion=6.1.0 +alaSecurityLibsVersion=6.2.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a25..98debb84 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c7873..65dcd68d 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -205,6 +209,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f9..6689b85b 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/grails-app/controllers/au/org/ala/collectory/SitemapController.groovy b/grails-app/controllers/au/org/ala/collectory/SitemapController.groovy index 541fc17c..899cfc12 100644 --- a/grails-app/controllers/au/org/ala/collectory/SitemapController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/SitemapController.groovy @@ -14,6 +14,8 @@ class SitemapController { return } + response.contentType = "application/xml" + if (idx == null) { // return sitemap index response.outputStream << index.newInputStream() diff --git a/grails-wrapper.jar b/grails-wrapper.jar index 6b6da64f..bc85146c 100644 Binary files a/grails-wrapper.jar and b/grails-wrapper.jar differ diff --git a/grailsw b/grailsw index 8d0cc123..c2c921c2 100755 --- a/grailsw +++ b/grailsw @@ -102,7 +102,6 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` JAVACMD=`cygpath --unix "$JAVACMD"` - JAR_PATH=`cygpath --path --mixed "$JAR_PATH"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..464e7af9 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,20 @@ +pluginManagement { + repositories { + mavenLocal() + maven { url "https://nexus.ala.org.au/content/groups/public/" } + maven { url "https://repo.grails.org/grails/core/" } + gradlePluginPortal() + } + plugins { + id "org.grails.grails-web" version "6.0.0" + id "org.grails.grails-gsp" version "6.0.0" + id "com.bertramlabs.asset-pipeline" version "4.3.0" +// classpath "org.grails:grails-gradle-plugin:$grailsVersion" +// classpath "org.grails.plugins:hibernate5:${gormVersion}" +// classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" +// classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.4.6" +// classpath 'org.grails.plugins:database-migration:4.2.0' + } +} + +rootProject.name='collectory'