Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions .github/workflows/java-ea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ env:

jobs:
test_jdk_ea:
strategy:
fail-fast: false
matrix:
java: [19-ea]
name: 'Linux JDK ${{ matrix.java }}'
name: 'Linux JDK EA'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
Expand Down
43 changes: 18 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,68 +24,61 @@ jobs:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: 'Test'
run: ./mvnw ${MAVEN_ARGS} -Djacoco.skip=true install -DskipDistribution=true
linux:
name: 'Linux JDK 11'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Set up JDK 11'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: 'Test'
run: ./mvnw ${MAVEN_ARGS} install
run: ./mvnw ${MAVEN_ARGS} -Djacoco.skip=${{ matrix.java != 17 }} install -DskipDistribution=${{ matrix.java != 17 }}
- name: 'Generate coverage report'
if: matrix.java == 17
run: ./mvnw jacoco:report
- name: 'Upload coverage to Codecov'
if: matrix.java == 17
uses: codecov/codecov-action@v2
- name: 'Publish Snapshots'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'mapstruct/mapstruct'
if: matrix.java == 17 && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'mapstruct/mapstruct'
run: ./mvnw -s etc/ci-settings.xml -DskipTests=true -DskipDistribution=true deploy
linux-jdk-8:
name: 'Linux JDK 8'
integration_test_jdk:
strategy:
fail-fast: false
matrix:
java: [ 8, 11 ]
name: 'Linux JDK ${{ matrix.java }}'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Set up JDK 11 for building everything'
- name: 'Set up JDK 17 for building everything'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
java-version: 17
- name: 'Install Processor'
run: ./mvnw ${MAVEN_ARGS} -DskipTests install -pl processor -am
- name: 'Set up JDK 8 for running integration tests'
- name: 'Set up JDK ${{ matrix.java }} for running integration tests'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
java-version: ${{ matrix.java }}
- name: 'Run integration tests'
run: ./mvnw ${MAVEN_ARGS} verify -pl integrationtest
windows:
name: 'Windows'
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: 'Set up JDK 11'
- name: 'Set up JDK 17'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
java-version: 17
- name: 'Test'
run: ./mvnw %MAVEN_ARGS% install
mac:
name: 'Mac OS'
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: 'Set up JDK 11'
- name: 'Set up JDK 17'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
java-version: 17
- name: 'Test'
run: ./mvnw ${MAVEN_ARGS} install
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: 'zulu'
cache: maven

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public Collection<String> getAdditionalCommandLineArguments(ProcessorTest.Proces

switch ( currentJreVersion ) {
case JAVA_8:
additionalExcludes.add( "org/mapstruct/ap/test/**/spring/**/*.java" );
additionalExcludes.add( "org/mapstruct/ap/test/injectionstrategy/cdi/**/*.java" );
additionalExcludes.add( "org/mapstruct/ap/test/injectionstrategy/jakarta_cdi/**/*.java" );
additionalExcludes.add( "org/mapstruct/ap/test/annotatewith/deprecated/jdk11/*.java" );
Expand All @@ -42,6 +43,8 @@ public Collection<String> getAdditionalCommandLineArguments(ProcessorTest.Proces
// TODO find out why this fails:
additionalExcludes.add( "org/mapstruct/ap/test/collection/wildcard/BeanMapper.java" );
break;
case JAVA_11:
additionalExcludes.add( "org/mapstruct/ap/test/**/spring/**/*.java" );
default:
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
package org.mapstruct.itest.tests;

import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.parallel.Execution;
Expand Down Expand Up @@ -80,12 +81,15 @@ void jakartaJaxbTest() {
}

@ProcessorTest(baseDir = "jsr330Test")
@EnabledForJreRange(min = JRE.JAVA_17)
@DisabledOnJre(JRE.OTHER)
void jsr330Test() {
}

@ProcessorTest(baseDir = "lombokBuilderTest", processorTypes = {
ProcessorTest.ProcessorType.JAVAC
})
@DisabledOnJre(JRE.OTHER)
void lombokBuilderTest() {
}

Expand All @@ -94,6 +98,7 @@ void lombokBuilderTest() {
ProcessorTest.ProcessorType.JAVAC_WITH_PATHS
})
@EnabledForJreRange(min = JRE.JAVA_11)
@DisabledOnJre(JRE.OTHER)
void lombokModuleTest() {
}

Expand Down Expand Up @@ -150,6 +155,7 @@ void expressionTextBlocksTest() {
}, forkJvm = true)
// We have to fork the jvm because there is an NPE in com.intellij.openapi.util.SystemInfo.getRtVersion
// and the kotlin-maven-plugin uses that. See also https://youtrack.jetbrains.com/issue/IDEA-238907
@DisabledOnJre(JRE.OTHER)
void kotlinDataTest() {
}

Expand All @@ -163,6 +169,8 @@ void defaultPackageTest() {
}

@ProcessorTest(baseDir = "springTest")
@EnabledForJreRange(min = JRE.JAVA_17)
@DisabledOnJre(JRE.OTHER)
void springTest() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,20 @@ private void addAdditionalCliArguments(Verifier verifier)
}

private void configureProcessor(Verifier verifier) {
String compilerId = processorTestContext.getProcessor().getCompilerId();
ProcessorTest.ProcessorType processor = processorTestContext.getProcessor();
String compilerId = processor.getCompilerId();
if ( compilerId != null ) {
String profile = processorTestContext.getProcessor().getProfile();
String profile = processor.getProfile();
if ( profile == null ) {
profile = "generate-via-compiler-plugin";
}
verifier.addCliOption( "-P" + profile );
verifier.addCliOption( "-Dcompiler-id=" + compilerId );
if ( processor == ProcessorTest.ProcessorType.JAVAC ) {
if ( CURRENT_VERSION.ordinal() >= JRE.JAVA_21.ordinal() ) {
verifier.addCliOption( "-Dmaven.compiler.proc=full" );
}
}
}
else {
verifier.addCliOption( "-Pgenerate-via-processor-plugin" );
Expand Down
10 changes: 10 additions & 0 deletions integrationtest/src/test/resources/fullFeatureTest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<additionalExclude4>x</additionalExclude4>
<additionalExclude5>x</additionalExclude5>
<additionalExclude6>x</additionalExclude6>
<additionalExclude7>x</additionalExclude7>
<additionalExclude8>x</additionalExclude8>
<additionalExclude9>x</additionalExclude9>
<additionalExclude10>x</additionalExclude10>
<additionalExclude11>x</additionalExclude11>
</properties>

<build>
Expand All @@ -49,6 +54,11 @@
<exclude>${additionalExclude4}</exclude>
<exclude>${additionalExclude5}</exclude>
<exclude>${additionalExclude6}</exclude>
<exclude>${additionalExclude7}</exclude>
<exclude>${additionalExclude8}</exclude>
<exclude>${additionalExclude9}</exclude>
<exclude>${additionalExclude10}</exclude>
<exclude>${additionalExclude11}</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerArgs>
<compilerArg>-proc:none</compilerArg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerArgs>
<compilerArg>-XprintProcessorInfo</compilerArg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerArgs>
<compilerArg>-proc:none</compilerArg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerArgs>
<compilerArg>-XprintProcessorInfo</compilerArg>
Expand Down
6 changes: 3 additions & 3 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<org.apache.maven.plugins.enforcer.version>3.4.1</org.apache.maven.plugins.enforcer.version>
<org.apache.maven.plugins.surefire.version>3.2.2</org.apache.maven.plugins.surefire.version>
<org.apache.maven.plugins.javadoc.version>3.1.0</org.apache.maven.plugins.javadoc.version>
<org.springframework.version>5.3.31</org.springframework.version>
<org.springframework.version>6.2.2</org.springframework.version>
<org.eclipse.tycho.compiler-jdt.version>1.6.0</org.eclipse.tycho.compiler-jdt.version>
<com.puppycrawl.tools.checkstyle.version>8.36.1</com.puppycrawl.tools.checkstyle.version>
<org.junit.jupiter.version>5.10.1</org.junit.jupiter.version>
Expand All @@ -47,7 +47,7 @@
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
<!--
The minimum Java Version that is needed to build a module in MapStruct.
The processor module needs at least Java 11.
The processor module needs at least Java 17.
-->
<minimum.java.version>1.8</minimum.java.version>
<protobuf.version>3.21.7</protobuf.version>
Expand Down Expand Up @@ -400,7 +400,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<!-- Netbeans has a problem when we use late binding with @ in the surefire arg line.
Therefore we set this empty property here-->
<jacocoArgLine />
<minimum.java.version>11</minimum.java.version>
<minimum.java.version>17</minimum.java.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._1395;
package org.mapstruct.ap.test.bugs._1395.spring;

import org.mapstruct.InjectionStrategy;
import org.mapstruct.Mapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._1395;
package org.mapstruct.ap.test.bugs._1395.spring;

import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._1395;
package org.mapstruct.ap.test.bugs._1395.spring;

/**
* @author Filip Hrisafov
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._1395;
package org.mapstruct.ap.test.bugs._1395.spring;

/**
* @author Filip Hrisafov
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._1395;
package org.mapstruct.ap.test.bugs._1395.spring;

/**
* @author Filip Hrisafov
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._2807;
package org.mapstruct.ap.test.bugs._2807.spring;

import org.mapstruct.ap.test.bugs._2807.after.AfterMethod;
import org.mapstruct.ap.test.bugs._2807.before.BeforeMethod;
import org.mapstruct.ap.test.bugs._2807.beforewithtarget.BeforeWithTarget;
import org.mapstruct.ap.test.bugs._2807.spring.after.AfterMethod;
import org.mapstruct.ap.test.bugs._2807.spring.before.BeforeMethod;
import org.mapstruct.ap.test.bugs._2807.spring.beforewithtarget.BeforeWithTarget;
import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._2807;
package org.mapstruct.ap.test.bugs._2807.spring;

import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.ap.test.bugs._2807.after.AfterMethod;
import org.mapstruct.ap.test.bugs._2807.before.BeforeMethod;
import org.mapstruct.ap.test.bugs._2807.beforewithtarget.BeforeWithTarget;
import org.mapstruct.ap.test.bugs._2807.spring.after.AfterMethod;
import org.mapstruct.ap.test.bugs._2807.spring.before.BeforeMethod;
import org.mapstruct.ap.test.bugs._2807.spring.beforewithtarget.BeforeWithTarget;
import org.mapstruct.factory.Mappers;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._2807.after;
package org.mapstruct.ap.test.bugs._2807.spring.after;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._2807.before;
package org.mapstruct.ap.test.bugs._2807.spring.before;

import org.mapstruct.BeforeMapping;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.bugs._2807.beforewithtarget;
package org.mapstruct.ap.test.bugs._2807.spring.beforewithtarget;

import java.util.List;

Expand Down
Loading