Skip to content

Feature 11549 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ node {
checkout scm
}
stage('Build and deployment') {
sh "./gradlew clean test install publish -Djava.awt.headless=true"
sh "./gradlew clean build publish -Djava.awt.headless=true"
}
}
}
58 changes: 28 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -24,9 +24,6 @@
import org.apache.tools.ant.filters.ReplaceTokens

buildscript {
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
}
repositories {
maven {
url 'https://www.silverpeas.org/nexus/content/groups/silverpeas'
@@ -38,15 +35,13 @@ buildscript {

plugins {
id 'java-gradle-plugin'
id 'org.ajoberstar.grgit' version '3.0.0' apply true
id 'org.ajoberstar.grgit' version '4.0.2' apply true
id 'idea'
id 'maven'
id 'maven-publish'
id 'groovy'
id "net.linguica.maven-settings" version "0.5"
}

apply plugin: 'maven-publish-auth'

description = 'The Gradle plugin to set up Silverpeas. It is used both to install or to upgrade Silverpeas.'
group = 'org.silverpeas'
version = '6.1-SNAPSHOT'
@@ -73,7 +68,7 @@ project.configure(project) {
repositories {
maven {
name 'silverpeas'
url 'http://www.silverpeas.org/nexus/content/groups/silverpeas'
url 'https://www.silverpeas.org/nexus/content/groups/silverpeas'
}
maven {
name 'gradle-plugins'
@@ -82,46 +77,49 @@ repositories {
mavenLocal()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
maven(MavenPublication) {
from components.java

artifact sourceJar {
classifier 'sources'
}
}
}

repositories {
maven {
if (project.snapshot) {
name 'silverpeas-snapshots'
url 'http://www.silverpeas.org/nexus/content/repositories/snapshots/'
url 'https://www.silverpeas.org/nexus/content/repositories/snapshots/'
} else {
name 'silverpeas'
url 'http://www.silverpeas.org/nexus/content/repositories/releases/'
url 'https://www.silverpeas.org/nexus/content/repositories/releases/'
}
}
}
}


dependencies {
compile gradleApi()
compile 'org.apache.commons:commons-lang3:3.6'
compile 'commons-io:commons-io:2.4'
compile 'org.apache.commons:commons-dbcp2:2.2.0'
compile 'commons-codec:commons-codec:1.10'
compile 'javax.jcr:jcr:2.0'
compile 'org.apache.jackrabbit:jackrabbit-core:2.18.2'
runtime 'org.eclipse.jetty:jetty-jndi:9.4.8.v20171121'
runtime 'org.eclipse.jetty:jetty-util:9.4.8.v20171121'
runtime 'com.h2database:h2:1.4.196'
runtime 'org.postgresql:postgresql:42.1.4'
runtime 'net.sourceforge.jtds:jtds:1.3.1'
testCompile gradleTestKit()
testCompile 'junit:junit:4.12'
testImplementation('org.spockframework:spock-core:1.1-groovy-2.4') {
api gradleApi()
api 'org.apache.commons:commons-lang3:3.10'
api 'commons-io:commons-io:2.7'
api 'org.apache.commons:commons-dbcp2:2.7.0'
api 'commons-codec:commons-codec:1.14'
api 'javax.jcr:jcr:2.0'
api 'org.apache.jackrabbit:jackrabbit-core:2.18.4'
runtimeOnly 'org.eclipse.jetty:jetty-jndi:9.4.29.v20200521'
runtimeOnly 'org.eclipse.jetty:jetty-util:9.4.29.v20200521'
runtimeOnly 'com.h2database:h2:1.4.200'
runtimeOnly 'org.postgresql:postgresql:42.2.12'
runtimeOnly 'net.sourceforge.jtds:jtds:1.3.1'
testImplementation gradleTestKit()
testImplementation 'junit:junit:4.13'
testImplementation('org.spockframework:spock-core:1.3-groovy-2.4') {
exclude module: 'groovy-all'
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Jan 23 14:16:56 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
59 changes: 36 additions & 23 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed 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
#
# https://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.
#

##############################################################################
##
## Gradle start up script for UN*X
@@ -28,16 +44,16 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
@@ -66,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -109,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
@@ -138,35 +156,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# 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" "$@"
23 changes: 22 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@@ -13,8 +29,11 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -65,7 +84,9 @@ set CMD_LINE_ARGS=%*

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
set JAVA_OPTS="%JAVA_OPTS% -Dillegal-access=permit"
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@ package org.silverpeas.setup

import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.Internal

import javax.inject.Inject
import java.nio.file.Files
@@ -42,24 +44,28 @@ class SilverpeasConfigurationProperties {
* configuration properties, the Silverpeas and the JBoss configuration directory. By default
* SILVERPEAS_HOME/configuration.
*/
@InputDirectory
final Property<File> configurationHome

/**
* The directory that contains all the configuration scripts to configure JBoss/Wildfly for
* Silverpeas. By default SILVERPEAS_HOME/configuration/jboss.
*/
@InputDirectory
final Property<File> jbossConfigurationDir

/**
* The directory that contains all the configuration scripts to configure specifically the
* Silverpeas web portal and components. By default SILVERPEAS_HOME/configuration/silverpeas.
*/
@InputDirectory
final Property<File> silverpeasConfigurationDir

/**
* The directory that contains the additional JBoss/Wildfly modules to install in JBoss/Wildfy
* for Silverpeas. By default SILVERPEAS_HOME/configuration/jboss/modules.
*/
@InputDirectory
final Property<File> jbossModulesDir

/**
@@ -68,6 +74,7 @@ class SilverpeasConfigurationProperties {
* that it can be retrieved in the next configuration process by the different steps so that they
* can adapt their behaviour according to the properties they have set.
*/
@Internal
final Context context

@Inject
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@ package org.silverpeas.setup
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Nested
import org.gradle.api.tasks.OutputDirectory

import javax.inject.Inject
/**
@@ -18,32 +21,37 @@ class SilverpeasInstallationProperties {
* directory is deployed as such in the JBoss/Wildfly application server.
* environment variable.
*/
@OutputDirectory
final Property<File> distDir

/**
* Directory that have to contain all the application or resource archives to deploy into
* JBoss/Wildfly. Defaulted in the SILVERPEAS_HOME/deployments directory.
*/
@OutputDirectory
final Property<File> deploymentDir

/**
* Directory that have to contain all the drivers required by Silverpeas and the Silverpeas Setup
* plugin to access the data source of Silverpeas.
*/
@OutputDirectory
final Property<File> dsDriversDir

/**
* Is in development mode? (In this case, some peculiar configuration are applied to support the
* dev mode in the application server.) This is a property and hence can be set by the user input
* from the build script.
*/
@Input
final Property<Boolean> developmentMode

/**
* Collections of software bundles required to construct the Silverpeas application.These bundles
* will be downloaded from our software repository server (provided by our Nexus service) and then
* unpacked to a given directory in order to generate the final application.
*/
@Nested
final SoftwareBundles bundles

@Inject
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package org.silverpeas.setup

import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.api.tasks.InputDirectory

import javax.inject.Inject

@@ -29,6 +30,7 @@ class SilverpeasMigrationProperties {
* </li>
* </ul>
*/
@InputDirectory
final Property<File> homeDir

@Inject
Loading
Oops, something went wrong.