Commit 853e0b36 authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

Merge branch 'master' into feature-XCOMMONS-2260

parents c4810ab6 604600a9
......@@ -25,7 +25,8 @@ updates:
interval: "weekly"
allow:
- dependency-type: "all"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
\ No newline at end of file
ignore:
# Ignore XWiki dependencies since we always keep them up to date and Dependabot has problems with maven properties
# defined in parent poms.
- dependency-name: "org.xwiki.*:*"
open-pull-requests-limit: 30
......@@ -23,6 +23,8 @@
extraction:
java:
index:
# XWiki on master is using Java 11
java_version: "11"
# Use the snapshot profile so that the XWiki Maven Remote repository is specified for locating snapshot
# artifacts.
build_command: "mvn clean install -Psnapshot"
......@@ -24,11 +24,11 @@
<extension>
<groupId>com.gradle</groupId>
<artifactId>gradle-enterprise-maven-extension</artifactId>
<version>1.10.5</version>
<version>1.14.1</version>
</extension>
<extension>
<groupId>com.gradle</groupId>
<artifactId>common-custom-user-data-maven-extension</artifactId>
<version>1.7.3</version>
<version>1.10.1</version>
</extension>
</extensions>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
import com.gradle.maven.extension.api.scan.BuildScanApi
/**
* Captures the Maven active profiles and add them as tags to the Build Scan. The goal is to make it simpler to
* filter builds on <a href="ge.xwiki.org">https://ge.xwiki.org</a> by filtering on Maven profiles.
*/
BuildScanApi buildScan = session.lookup('com.gradle.maven.extension.api.scan.BuildScanApi')
if (!buildScan) {
return
}
buildScan.executeOnce('tag-profiles') { BuildScanApi buildScanApi ->
// Add all maven profile names as tags
project.activeProfiles.each { buildScanApi.tag(it.id) }
// Add all system properties starting with "xwiki" as custom values
project.properties.find { it.key.startsWith('xwiki') }.each { buildScanApi.value(it.key, it.value) }
// Add specific tags to make it easy to recognize with wich environment a docker functional tests has been executed
def servletContainer = project.properties.'xwiki.test.ui.servletEngine'
def servletContainerTag = project.properties.'xwiki.test.ui.servletEngineTag'
if (servletContainer && servletContainerTag) {
buildScanApi.tag("${servletContainer.toLowerCase()} ${servletContainerTag.toLowerCase()}")
}
def database = project.properties.'xwiki.test.ui.database'
def databaseTag = project.properties.'xwiki.test.ui.databaseTag'
if (database && databaseTag) {
buildScanApi.tag("${database.toLowerCase()} ${databaseTag.toLowerCase()}")
}
def browser = project.properties.'xwiki.test.ui.browser'
if (browser) {
buildScanApi.tag(browser.toLowerCase())
}
}
......@@ -28,18 +28,36 @@
</server>
<buildScan>
<publishIfAuthenticated>true</publishIfAuthenticated>
<publish>ALWAYS</publish>
<!-- Always publish build scans on CI but on demand for devs so that we don't get false positives on ge.xwiki.org
due to local changes from users and so that it doesn't pollute the ge.xwiki.org data.
To force publishing a build scan: -Dscan -->
<publish>#{env['CI'] == null ? 'ON_DEMAND' : 'ALWAYS'}</publish>
<captureGoalInputFiles>true</captureGoalInputFiles>
<!-- Use background scans only locally to avoid potential issues on CI (the ephemeral docker agent could terminate
as soon as the build is finished and thus the upload may be terminated before it completes) -->
<backgroundBuildScanUpload>#{env['CI'] == null}</backgroundBuildScanUpload>
</buildScan>
<buildCache>
<!-- Notes:
* To disable the local build cache on the command line, pass: -Dgradle.cache.local.enabled=false
* We disable the local build cache on CI since our agents are transients and isolated, and thus it would cost
more to save the goal outputs since they're not going to be re-used.
-->
<local>
<enabled>true</enabled>
<enabled>#{env['CI'] == null}</enabled>
</local>
<remote>
<enabled>false</enabled>
<!-- Notes:
* To disable the remote build cache on the command line, pass: -Dgradle.cache.remote.enabled=false
-->
<enabled>true</enabled>
<!-- Only CI jobs are allowed to store build outputs in the remote cache -->
<storeEnabled>#{env['CI'] != null}</storeEnabled>
<server>
<!-- Note: Remote cache authentication is handled in the Maven settings.xml file. The id below is the one
found in settings.xml -->
<id>gradleEnterpriseCache</id>
</server>
</remote>
</buildCache>
</gradleEnterprise>
......@@ -80,14 +80,8 @@ stage ('Commons Builds') {
name: 'Quality',
goals: 'clean install jacoco:report sonar:sonar',
profiles: 'quality,legacy,coverage',
// Note: We specify the "jvm" system property to to execute the tests with Java 8 in order to limit problems
// with more recent versions of Java. In the future, we'll need to be able to also execute the tests with
// Java 14+. Remove that when we support it. See for example https://jira.xwiki.org/browse/XCOMMONS-2136
properties: '-Dxwiki.jacoco.itDestFile=`pwd`/target/jacoco-it.exec -Djvm=/home/hudsonagent/java8/bin/java',
properties: '-Dxwiki.jacoco.itDestFile=`pwd`/target/jacoco-it.exec',
sonar: true,
// Build with Java 14 since Sonar requires Java 11+ and we want at the same time to verify that XWiki builds
// with the latest Java version.
javaTool: 'java14'
)
}
}
......
......@@ -21,6 +21,7 @@ Read our [Release Notes](http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/).
* [Continuous Integration](http://ci.xwiki.org/) setup launches a build for each commit
* [Issue Tracker](http://jira.xwiki.org/browse/XCOMMONS) if you want to report an issue
* [Development Flow](http://dev.xwiki.org/xwiki/bin/view/Community/DevelopmentPractices#HGeneralDevelopmentFlow) to see the full list of tools we use to build XWiki
* [![Revved up by Gradle Enterprise](https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.xwiki.org/scans)
## Community
We're always looking for contributors!
......
This diff is collapsed.
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-pom</artifactId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
<relativePath>../xwiki-commons-pom</relativePath>
</parent>
<artifactId>xwiki-commons-core</artifactId>
......@@ -53,6 +53,7 @@
<module>xwiki-commons-job</module>
<module>xwiki-commons-logging</module>
<module>xwiki-commons-management</module>
<module>xwiki-commons-netflux</module>
<module>xwiki-commons-observation</module>
<module>xwiki-commons-properties</module>
<module>xwiki-commons-repository</module>
......@@ -77,6 +78,32 @@
</archive>
</configuration>
</plugin>
<!-- Used to automatically register our custom JUnit5 Extensions using the service loader mechanism.
We also need to have the JAR containing our extensions visible to JUnit5's ClassLoader. This is
done here and not in the top level pom.xml, as otherwise it would cause a cyclic dependency.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-tool-test-simple</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-tool-test-simple</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
......@@ -165,66 +192,41 @@
Common justification example:
<revapi.differences>
<justification>This change is necessary to fix bug #1234</justification>
<criticality>highlight</criticality>
<differences>
<item>
<code>java.method.addToInterface</code>
<fullQualifiedClassName>com.acme.ToolInterface</fullyQualifiedClassName>
<new>method void com.acme.ToolInterface::setup()</new>
</item>
<item>
<code>java.method.removed</code>
<fullQualifiedClassName>com.acme.ToolInterface</fullyQualifiedClassName>
<old>method void com.acme.ToolInterface::initialize()</old>
<justification>...</justification>
</item>
</differences>
</revapi.differences>
<revapi.differences>
<justification>This change is necessary to fix bug #1234</justification>
<criticality>highlight</criticality>
<differences>
<item>
<code>java.method.addToInterface</code>
<fullQualifiedClassName>com.acme.ToolInterface</fullyQualifiedClassName>
<new>method void com.acme.ToolInterface::setup()</new>
</item>
<item>
<code>java.method.removed</code>
<fullQualifiedClassName>com.acme.ToolInterface</fullyQualifiedClassName>
<old>method void com.acme.ToolInterface::initialize()</old>
<justification>...</justification>
</item>
</differences>
</revapi.differences>
Single justification example:
<revapi.differences>
<differences>
<item>
<code>java.method.removed</code>
<old>method void org.xwiki.diff.xml.XMLDiff::xxx()</old>
<justification>Unstable API added by mistake.</justification>
<criticality>highlight</criticality>
</item>
</differences>
</revapi.differences>
<revapi.differences>
<differences>
<item>
<code>java.method.removed</code>
<old>method void org.xwiki.diff.xml.XMLDiff::xxx()</old>
<justification>Unstable API added by mistake.</justification>
<criticality>highlight</criticality>
</item>
</differences>
</revapi.differences>
-->
</analysisConfiguration>
</configuration>
</plugin>
<!-- Used to automatically register our custom JUnit5 Extensions using the service loader mechanism.
We also need to have the JAR containing our extensions visible to JUnit5's ClassLoader. This is
done here and not in the top level pom.xml, as otherwise it would cause a cyclic dependency.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-tool-test-simple</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-tool-test-simple</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
......
......@@ -19,12 +19,12 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>xwiki-commons-core</artifactId>
<groupId>org.xwiki.commons</groupId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-blame</artifactId>
<name>XWiki Commons - Blame</name>
......
......@@ -19,12 +19,12 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>xwiki-commons-blame</artifactId>
<groupId>org.xwiki.commons</groupId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-blame-api</artifactId>
<name>XWiki Commons - Blame - API</name>
......@@ -44,8 +44,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.java-diff-utils</groupId>
<artifactId>diffutils</artifactId>
<groupId>io.github.java-diff-utils</groupId>
<artifactId>java-diff-utils</artifactId>
</dependency>
</dependencies>
</project>
......@@ -27,9 +27,9 @@
import org.xwiki.blame.AnnotatedContent;
import org.xwiki.blame.AnnotatedElement;
import difflib.Chunk;
import difflib.Delta;
import difflib.DiffUtils;
import com.github.difflib.patch.Chunk;
import com.github.difflib.patch.AbstractDelta;
import com.github.difflib.DiffUtils;
/**
* Hold content during blame analysis and provides actual results.
......@@ -142,13 +142,13 @@ void analyseRevision(R revision, List<E> previous)
*
* @param deltas the delta to apply to current content to move to previous revision.
*/
private void resolveToCurrent(List<Delta<E>> deltas)
private void resolveToCurrent(List<AbstractDelta<E>> deltas)
{
int lineOffset = 0;
for (Delta<E> d : deltas) {
Chunk<E> original = d.getOriginal();
Chunk<E> revised = d.getRevised();
for (AbstractDelta<E> d : deltas) {
Chunk<E> original = d.getSource();
Chunk<E> revised = d.getTarget();
int pos = original.getPosition() + lineOffset;
// delete lines
......
......@@ -19,12 +19,12 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>xwiki-commons-blame</artifactId>
<groupId>org.xwiki.commons</groupId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-blame-script</artifactId>
<name>XWiki Commons - Blame - Script Service</name>
......
......@@ -25,7 +25,7 @@
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-core</artifactId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-cache</artifactId>
<name>XWiki Commons - Cache - Parent POM</name>
......
......@@ -25,7 +25,7 @@
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-cache</artifactId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-cache-api</artifactId>
<name>XWiki Commons - Cache - API</name>
......
......@@ -24,7 +24,7 @@
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-cache</artifactId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-cache-infinispan</artifactId>
<name>XWiki Commons - Cache - Infinispan</name>
......
......@@ -25,7 +25,7 @@
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-cache</artifactId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-cache-tests</artifactId>
<name>XWiki Commons - Cache - Tests</name>
......
......@@ -25,7 +25,7 @@
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-core</artifactId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-classloader</artifactId>
<name>XWiki Commons - ClassLoader - Parent POM</name>
......
......@@ -25,7 +25,7 @@
<parent>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-classloader</artifactId>
<version>13.9-SNAPSHOT</version>
<version>14.5-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-classloader-api</artifactId>
<name>XWiki Commons - ClassLoader - API</name>
......
......@@ -72,7 +72,6 @@ public NamespaceURLClassLoader(URI[] uris, ClassLoader parent, String namespace)
* @param namespace see {@link #getNamespace()}
* @since 12.5RC1
*/
@Unstable
public NamespaceURLClassLoader(URL[] urls, ClassLoader parent, String namespace)
{
this(urls, parent, null, namespace);
......@@ -99,7 +98,6 @@ public NamespaceURLClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerF
* @param namespace see {@link #getNamespace()}
* @since 12.5RC1
*/
@Unstable
public NamespaceURLClassLoader(ClassLoader parent, String namespace)
{
this(EMPTY_URIS, parent, namespace);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment