Note
Intershop Gradle Tools 2.11 are included in Intershop Commerce Management 7.8. The new version of Intershop Gradle Tools can also be used alongside with Intershop Commerce Management 7.6 and 7.7.
Gradle Tools 2.11 are based on Gradle 2.11.
Warning
When updating to Gradle Tools 2.11, please delete your gradle cache to ensure a smooth update. This also applies for an update to Gradle Tools 2.11.6.
To use Gradle Tools 2.11 with Intershop Commerce Management 7.6 or 7.7, perform the following steps to migrate your environment:
createCorporateDistribution
.distributionUrl
in gradle/wrapper/gradle-wrapper.properties.In your gradle.properties files, remove the following properties if they exist:
filter.com.intershop.build.set.cartridge-plugins filter.com.intershop.build.set.extension-plugins version.com.intershop.deployment-bootstrap
and add the following property instead:
filter.com.intershop.build.gradle.gradle-tools = 2.11.4 version.com.intershop.build.gradle.deployment-launcher = 2.11.4
For more information regarding deployment-bootstrap, see section Product-Specific Deployment Components in Platform.
Use the sources of the Responsive Starter Store to configure the project (Recipe: Set Up Project Based on the Responsive Starter Store in Cookbook - Setup CI Infrastructure).
Note
Intershop recommends to change the project structure to reduce the efforts for the development, the build itself and the maintenance of a build.
Copy your assembly in the Gradle project with the store cartridges and adapt your assembly according to the sources of the assembly in the original source package.
To use the new Gradle Tools with Intershop Commerce Management 7.8 and later, perform the following steps to migrate your environment:
Regenerate the corporate configuration after changes in the initialization script (see Migrate Version Configuration).
Note
This only works if you are already using version 2.11 of Gradle. If you want to migrate from an older version, you have to migrate to version 2.11.0 first (see Gradle Tools 2.11)
For the update of Gradle Tools 2.11.6 to this version no special changes are necessary.
This version will replace the default multicast configuration of ICM in a development and CI test environment with a JGroups configuration. Therefore the deployment DSL was extended:
jgroups { appserver { // the file configFileName = 'jgroups_udp.xml' acknowledge = false syncAcknowledge = false requestTimeout = 1000 networkInterface = '' } tcm { // see configuration of app server } cache {{ // see configuration of app server } orm {{ // see configuration of app server } }
This change is also included in the 'com.intershop.deployment' package version 2.0.0.
This release of Intershop Gradle Tools is based on Gradle 2.11. The previous release was based on Gradle 2.7. Please see Gradle's release notes for information about changes:
Notable changes include:
Excludes for transitive dependencies are now published in the Ivy descriptor. Previously the only supported way to exclude unwanted dependencies was a global exclude in the assembly. Since Gradle 2.11, you should prefer the new approach:
dependencies { [...] // use org.jdom:jdom instead of jdom:jdom brought in by rome compile 'org.jdom:jdom' compile('rome:rome') { // this exclude is now published and respected by later build steps // no further exclude is needed in the assembly anymore exclude group:'jdom', module:'jdom' } }
The build tools now also support the Gradle standard layout. This is now the standard structure for cartridges.
Note
Intershop recommends to transfer existing projects to this standard structure.
Intershop provides a script for a simple migration on GitHub https://github.com/IntershopCommunicationsAG/project-layout-migration-script.
Special build plugins (Jaxb, Resourcelist, WSDL, ISML) are reimplemented and moved to Open Source. The source code of these plugins is available on https://github.com/IntershopCommunicationsAG and the binaries are available on JCenter (https://bintray.com/intershopcommunicationsag/maven).
Note
Intershop recommends to use these plugins instead of the integrated and deprecated plugins. The integrated plugins will be removed in further versions. Problems and issues in these plugins will be solved only on the public plugins.
Note
The Intershop Gradle Tool Set comes with some Gradle plugins, which are integrated in the build process of Cartridges. Intershop intends to move these plugins to OpenSource in the future.
The following plugins are available on GitHub:
Description | GitHub Project | Plugin ID | Latest Version | replaces plugin from Gradle Tools | introduced in version |
---|---|---|---|---|---|
Jaxb code generator plugin | jaxb-gradle-plugin | com.intershop.gradle.jaxb | 2.1.0 | Jaxb plugin | 2.11.5 |
JavaCC code generator plugin | javacc-gradle-plugin | com.intershop.gradle.javacc | 1.0.0 | JavaCC plugin | 2.11.5 |
ResourceList generator plugin | resourcelist-gradle-plugin | com.intershop.gradle.resourcelist | 1.0.1 | ResourceList plugin | 2.11.5 |
SonarQube(TM) code analysis plugin | sonarqube-gradle-plugin | com.intershop.gradle.sonarQube | 2.1.0 | Sonar plugin | 2.11.5 |
WSDL code generator plugin | wsdl-gradle-plugin | com.intershop.gradle.wsdl | 1.0.3 | WSDL plugin | 2.11.6 |
ISML compiler plugin | isml-gradle-plugin | com.intershop.gradle.isml | 1.0.2 | ISML plugin | 2.11.6 |
Version recommendation plugin | versionrecommender-gradle-plugin | com.intershop.gradle.versionrecommender | 1.3.5 | Versioning plugin | 2.11.6 |
Plugins with a replacement on GitHub are deprecated and will be removed in future versions of Intershop's Gradle Tools.
It is possible to deactivate the included plugins so that the new plugins can be used. Therefore it is necessary to add a property to the gradle.properties file.
Plugin (Grade Tools) | Property | Introduced in version |
---|---|---|
Jaxb plugin | disableStandardJaxb = true | 2.11.5 |
JavaCC plugin | disableStandardJavacc = true | 2.11.5 |
ResourceList plugin | disableStandardResourceListPlugin = true | 2.11.5 |
WSDL plugin | disableStandardWSDL = true | 2.11.6 |
ISML plugin | disableStandardISML = true | 2.11.6 |
TLoc plugin | disableStandardISML = true | 2.11.7 |
The TLoc plugin is no longer necessary.
Note
The ISML plugin does not support spaces in the absolute path of the project.
After deactivating, it is necessary to configure the new plugins in the necessary build scripts (see documentation on GitHub - follow links for GitHub in the table above). The main steps are:
Add the dependency in the build script block in the build.gradle of the root project.
buildscript { dependencies { ... classpath 'com.intershop.gradle.resourcelist:resourcelist-gradle-plugin:2.1.0' classpath 'com.intershop.gradle.jaxb:jaxb-gradle-plugin:1.0.1' classpath 'com.intershop.gradle.isml:isml-gradle-plugin:1.0.2' classpath 'com.intershop.gradle.wsdl:wsdl-gradle-plugin:1.0.3' ... } }
Add plugins to existing sub projects and adapt the build scripts.
Add the Jaxb plugin to the required build scripts.
apply plugin: 'java-cartridge' apply plugin: 'static-cartridge' //add plugins apply plugin: 'com.intershop.gradle.jaxb' apply plugin: 'com.intershop.gradle.cartridge-resourcelist' intershop { displayName = 'Component' } //add plugin configuration if necessary jaxb { javaGen { genname { schema = file('staticfiles/definition/bc_region.xsd') binding = file('staticfiles/definition/bc_region.xjb') } } } dependencies { ... }
Add the ResourceList plugin to the required build scripts.
apply plugin: 'java-cartridge' apply plugin: 'static-cartridge' apply plugin: 'com.intershop.gradle.cartridge-resourcelist' intershop { displayName = 'Component' } dependencies { ... }
Add the WSDL plugin to the required build scripts.
apply plugin: 'java-cartridge' apply plugin: 'static-cartridge' apply plugin: 'com.intershop.gradle.wsdl' intershop { displayName = 'Component' } wsdl { axis1 { ... } axis2 { ... } } dependencies { ... }
Note
Please verify the configuration
The default parameters of the public plugin depend on the values of the command line tools.
See https://github.com/IntershopCommunicationsAG/wsdl-gradle-plugin for details.
Add the ISML plugin to the required build scripts.
apply plugin: 'java-cartridge' apply plugin: 'static-cartridge' apply plugin: 'com.intershop.gradle.isml' intershop { displayName = 'Component' //add output of the plugin the cartridge package packages { cartridge { srcDir(isml2classMain) } } } dependencies { ... }
Note
Known Issues for 2.11.6
ISTOOLS-2820: disableStandardISML = true" does not work.
Currently a versioning plugin is applied with the initialization script as part of the corporate distribution. This plugin will be replaced by the "Version Recommender Plugin". See Migrate Version Configuration and versionrecommender-gradle-plugin.
Intershop delivers a Responsive Starter Store for an easy project start. There is a project with sources for components - component set a_responsive - and an assembly project insprired-b2x or inspired-b2c. These projects were renamed with the creation of the project. The present document uses the original names for the migration of the projects. inspired-b2x is a synonym for inspired-b2x and inspired-b2c.
Please use the document Cookbook - Setup CI Infrastructure for your changes on the CI process.
For the migration of your project, we use the generated sources of createProject
. The sources are located in <sources>/projects/<project name, e.g., corporateshop>.
Copy the content of <sources>/projects/<project name, e.g., corporateshop> to the component set. Existing files must be overwritten.
Update your gradle.properties.
Change
filter.com.intershop.build.set.cartridge-plugins = 2.7.1
to
filter.com.intershop.build.gradle.gradle-tools = 2.11.4 version.com.intershop.deployment-bootstrap = 2.11.4
Update your build.gradle.
Use the template build.gradle and replace the following placeholder:
Placeholder | Content |
---|---|
<project description> | Project description |
<project group> | Group of the project, e.g., com.company.project |
<assembly name> | Name of the assembly project |
<sonar-host> | Host name of the SonarQube server. If no SonarQube is used in the project, it is possible to remove the SonarQube Gradle plugin. Remove SonarQube Gradle plugin apply plugin: 'com.intershop.gradle.sonarQube' sonarqube { sonarProperties { property 'sonar.host.url', 'https://<sonar-host>' } } |
It is also necessary to change the configuration com.intershop.assembly:commerce_management_b2x
to com.intershop.assembly:commerce_management_b2c
if you use Intershop Commerce Management B2C only.
Update your settings.gradle.
Use the template settings.gradle and replace the following placeholder:
Placeholder | Content |
---|---|
<project name> | project name |
Update Gradle and Gradle build tools for the assembly project.
Copy the assembly project in the component set.
Using Subversion it is possible to use svn cp
.
Remove group and version configuration.
group = '<group>' version = '<version>'
Replace plugin and dependency configuration.
buildscript { repositories { maven { ... } } dependencies { classpath 'com.intershop.build.gradle:ish-assembly' classpath 'com.intershop.build.gradle:plugin-tests' classpath 'com.intershop.build.release:intershop-buildinfo-plugin:2.2.8' } } apply plugin: 'ish-assembly' apply plugin: 'ish-assembly-branding' apply plugin: 'buildinfo'
buildscript { dependencies { classpath 'com.intershop.build.gradle:ish-assembly' classpath 'com.intershop.build.gradle:plugin-tests' classpath 'com.github.groovy-wslite:groovy-wslite:1.+' } } apply plugin: 'ish-assembly' apply plugin: 'ish-assembly-branding' // optional apply plugin: 'project-report' apply plugin: 'jacoco'
assembly
block replace all dependencies contained in your component set with project dependencies, e.g., com.intershop.foo:bar
becomes project(':bar')
.fooCartridges.collect {"com.intershop.foo:$it"}
becomes fooCartridges.collect { project(":$it") }
Test your changes.
Execute gradlew publish
and gradlew deployServer
.
Note
It is necessary to configure your Gradle environment before you run the commands. Please use the available scripts.
Note
In the first step, it is necessary to adapt the corporate distribution. Therefore it is necessary to change the initialization script and create a build of the distribution.
The old versioning plugin must be removed from the class path in the initialization script.
dependencies { + //Repository configuration - provided by Intershop + classpath 'com.intershop.gradle.repoconfig:repoconfig-gradle-plugin:3.1.0' - // versioning plugin - provided by Intershop - classpath 'com.intershop.build.gradle:versioning:2.11.?' }
This configuration block must be removed from the initialization script.
-allprojects { - // Versioning plugin - project.plugins.apply(com.intershop.build.gradle.plugins.VersioningPlugin) -}
Create a new release of the corporate distribution.
Note
The following changes must be done on the files in the root project.
Add the plugin to the build script section.
buildscript { dependencies { ... + classpath 'com.intershop.gradle.versionrecommender:versionrecommender-gradle-plugin:1.3.3' ... } }
Add all necessary version information to Gradle plugins in the build script section.
buildscript { dependencies { ... + classpath 'com.intershop.build.gradle:assembly:2.11.6' + classpath 'com.intershop.build.gradle:ish-component-plugin:2.11.6' + classpath 'com.intershop.build.gradle:hot-code-reloading:2.11.6' ... } }
Apply the plugin to the root project.
... version = scm.version.version apply plugin: 'com.intershop.gradle.versionrecommender' apply plugin: 'hot-code-reloading' ...
Configure the version recommender plugin.
... versionRecommendation { provider { // default dependencies ivy('icm-b2c', 'com.intershop.assembly:commerce_management_b2c:7.9.0.0') {} // intershop build dependencies properties('intershopBuild', file('intershopBuild.version')) {} } // all versions are used from providers forceRecommenderVersion = true excludeProjectsbyName = ['microservices'] updateConfiguration { // Necessary for update of ivy artifacts ivyPattern = com.intershop.gradle.repoconfig.RepoConfigRegistry.ivyPattern defaultUpdateProvider = ['icm-b2c'] defaultUpdate = 'MINOR' } } def assemblyProjects = ...
Add the new file intershopBuild.version.
com.intershop.build.gradle:assembly = 2.11.6 com.intershop.build.gradle:plugin-tests = 2.8.1 com.intershop.build.gradle:versioning = 2.11.6 com.intershop.build.gradle:deployment-framework = 2.11.6 com.intershop.build.gradle:deployment-test = 2.11.6 com.intershop.build.gradle:ish-common = 2.11.6 com.intershop.build.gradle:ish-assembly-test = 2.11.6
Remove the version configuration from the gradle.properties file.
Properties starting with version.
or filter.
can be removed.
Note
The following steps must be done on the build.gradle file of the assembly project.
Remove the version configuration from the build.gradle file.
... buildDir = new File(projectDir, 'target') // if(name == 'inspired-b2c') { // versioning { // useVersionsFrom 'com.intershop.assembly:commerce_management_b2c' // } // } if(! assemblyProjects.contains(it)) { ... ... // apply plugin: 'com.intershop.gradle.sonarQube' // versioning { // useVersionsFrom 'com.intershop.assembly:commerce_management_b2x' // } sonarqube { ...
Add the necessary version information to the build script section.
buildscript { dependencies { classpath 'com.intershop.build.gradle:plugin-tests:2.8.1' classpath 'com.github.groovy-wslite:groovy-wslite:1.1.3' } } ...
For more information please see the original documentation of the plugin on GitHub versionrecommender-gradle-plugin.
With the introduction of Gradle Tools 2.11 and the release of Intershop Commerce Management 7.8, some Intershop-specific deployment logic has been moved from Gradle Tools into a separate project.
For Intershop Commerce Management 7.6 and 7.7 the deployment and assembly tools are still part of the Gradle Tools 2.11 delivery.
Since ish-assembly and a part of deployment-bootstrap have been moved to a separate project, several changes are necessary.
Note
This change will be delivered completely with Intershop Commerce Management 7.8.
The sub-project deploy-bootstrap was split up into several sub-projects, and depending on the context, different adaptions are necessary.
The DeploymentBootstrapPlugin is now part of the deployment-launcher sub-project. Therefore:
Replace the following code:
classpath 'com.intershop:deployment-bootstrap:2.11.+'
by
classpath 'com.intershop.build.gradle:deployment-launcher:2.11.+'
The Intershop-specific deployment logic is part of p_platform now. Therefore, in the build.gradle of the platform assembly:
Replace the following code:
dependencies { 'deploy-plugins' "com.intershop:deployment-bootstrap" ... }
by
dependencies { 'deploy-plugins' project(':deploy_platform') 'deploy-plugins' project(':assembly_operations') .. }
Note
dependencies { 'deploy-plugins' 'com.intershop.deployment:deploy-intershop' 'deploy-plugins' 'com.intershop.deployment:assembly-toolbox' .. }
It is necessary to avoid implicit dependencies to the deployment-bootstrap. They may occur, for example, if a component set depends on another component set that depends on deployment-bootstrap, e.g., p_platform depends on p_infrastructure, which still has the dependency to deployment-bootstrap. In the deploy-settings.gradle, the HostTypeSettingsPlugin is required, which is now located in the sub-project deploy_platform within com.intershop.platform.
Therefore the following code has to be added in the deploy-settings.gradle to replace the dependencies:
apply plugin:com.intershop.deploy.settings.HostTypeSettingsPlugin // Substitutes 'com.intershop:deployment-bootstrap' with 'com.intershop.platform:deploy_platform' (so not all *.gradle files have to be changed) gradle.allprojects{project -> project.apply(plugin:com.intershop.deploy.settings.MigrateBootstrapPlugin) }as Action
Note
apply plugin:com.intershop.deploy.settings.HostTypeSettingsPlugin // Substitutes 'com.intershop:deployment-bootstrap' with 'com.intershop.deployment:deploy-intershop' (so not all *.gradle files have to be changed) gradle.allprojects{project -> project.apply(plugin:com.intershop.deploy.settings.MigrateBootstrapPlugin) }as Action
Since ish-assembly and the operations assembly are now part of p_platform, the following replacement is necessary in the build.gradle of the assemblies (f_business, f_b2b):
buildscript { dependencies { classpath 'com.intershop.build.gradle:ish-assembly' ... } }
by
buildscript { dependencies { classpath 'com.intershop.platform:assembly_operations' ... } }
Note
Using Gradle Tools 2.11.6, the classpaths 'com.intershop.build.gradle:ish-assembly'
or 'com.intershop.platform:assembly_operations'
need to be replaced by 'com.intershop.deployment:assembly-toolbox:1.0.0'
.
The following plugins provided by Intershop are now deprecated and will be removed from the next release without a replacement:
com.intershop.build.plugins.SubProjectsPlugin
This functionality can be replaced with a script in the settings.gradle:
def excludeList = ['gradle', '.gradle', 'target', 'build', 'bin', 'reports'] def dirMatch = {dirPath -> File dirFile = new File(dirPath) ! excludeList.contains(dirFile.name) && dirFile.list()?.contains('build.gradle') } rootDir.eachDirMatch(dirMatch) {File proj -> include ":${proj.name}" }
Note
The corporate plugin and the corporate plugin configuration have been replaced by the public Gradle plugin repoconfig-gradle-plugin.
The Hotfix Importer was removed with Gradle Tools 2.8, after being deprecated with Gradle Tools 2.7, and replaced by the Intershop Public Repository (see Public Release Notes - Gradle Tools - Version 2.7 | Deprecations | Hotfix Import Workflow Replaced by the Intershop Public Repository).
Since Version 2.8, Gradle ships with Groovy 2.4.4 instead of 2.3.10. The migration should be seamless in general, but there might be some binary compatibility issues when using Groovy with @CompileStatic
. Additionally, Spock has been updated accordingly from 1.0-groovy-2.3 to 1.0-groovy-2.4.
.gradle
script files, if any.Due to the update of Groovy it was necessary to adapt the version of the Geb test framework accordingly. The new version is not completely compatible with the latest used version (0.12.2).
Please check the documentation on http://www.gebish.org for more information.
2.11.10
2.11.9
2.11.8
2.11.7
2.11.6
2.11.5