From d81d3e46a4b19191fff808c3b963001c6fe41a47 Mon Sep 17 00:00:00 2001 From: Florian Tavares Date: Mon, 15 Oct 2018 22:16:33 +0200 Subject: [PATCH] #1301 Use Java 8 as baseline for MapStruct * Move classes from mapstruct-common into mapstruct * Use Java 8 @Repeatable for @Mappings and @ValueMappings in the mapstruct module * Add relocation for mapstruct-jdk8 to mapstruct * Use of 1.8 source and target versions from parent POM * Update documentation to match * Update versions of some maven plugin crashing build on Java 8 * Drop JDK 6 & 7 support in integration tests * Remove mapstruct-common module (it was never deployed to Central) --- core-common/pom.xml | 58 ---- core-jdk8/pom.xml | 147 +--------- .../src/main/java/org/mapstruct/Mapping.java | 270 ------------------ .../src/main/java/org/mapstruct/Mappings.java | 28 -- .../main/java/org/mapstruct/ValueMapping.java | 113 -------- .../java/org/mapstruct/ValueMappings.java | 24 -- core/pom.xml | 38 --- .../main/java/org/mapstruct/AfterMapping.java | 0 .../main/java/org/mapstruct/BeanMapping.java | 0 .../java/org/mapstruct/BeforeMapping.java | 0 .../src/main/java/org/mapstruct/Builder.java | 0 .../mapstruct/CollectionMappingStrategy.java | 0 .../src/main/java/org/mapstruct/Context.java | 0 .../java/org/mapstruct/DecoratedWith.java | 0 .../org/mapstruct/InheritConfiguration.java | 0 .../InheritInverseConfiguration.java | 0 .../java/org/mapstruct/InjectionStrategy.java | 0 .../java/org/mapstruct/IterableMapping.java | 0 .../main/java/org/mapstruct/MapMapping.java | 0 .../src/main/java/org/mapstruct/Mapper.java | 0 .../main/java/org/mapstruct/MapperConfig.java | 0 core/src/main/java/org/mapstruct/Mapping.java | 13 +- .../java/org/mapstruct/MappingConstants.java | 0 .../mapstruct/MappingInheritanceStrategy.java | 0 .../java/org/mapstruct/MappingTarget.java | 0 .../src/main/java/org/mapstruct/Named.java | 0 .../org/mapstruct/NullValueCheckStrategy.java | 0 .../mapstruct/NullValueMappingStrategy.java | 0 .../java/org/mapstruct/ObjectFactory.java | 0 .../main/java/org/mapstruct/Qualifier.java | 0 .../java/org/mapstruct/ReportingPolicy.java | 0 .../main/java/org/mapstruct/TargetType.java | 0 .../main/java/org/mapstruct/ValueMapping.java | 19 +- .../java/org/mapstruct/factory/Mappers.java | 0 .../org/mapstruct/factory/package-info.java | 0 .../main/java/org/mapstruct/package-info.java | 0 .../java/org/mapstruct/util/Experimental.java | 0 .../org/mapstruct/factory/MappersTest.java | 0 .../factory/PackagePrivateMapper.java | 0 .../factory/PackagePrivateMapperImpl.java | 0 .../java/org/mapstruct/test/model/Foo.java | 0 .../org/mapstruct/test/model/FooImpl.java | 0 .../test/model/SomeClass$FooImpl.java | 0 .../model/SomeClass$NestedClass$FooImpl.java | 0 .../org/mapstruct/test/model/SomeClass.java | 0 distribution/pom.xml | 5 - distribution/src/main/assembly/dist.xml | 1 - .../mapstruct-reference-guide.asciidoc | 14 +- etc/toolchains-cloudbees-jenkins.xml | 23 -- etc/toolchains-example.xml | 22 -- etc/toolchains-travis-jenkins.xml | 23 +- integrationtest/pom.xml | 8 - .../tests/FullFeatureCompilationTest.java | 13 - .../itest/tests/LombokBuilderTest.java | 2 - .../itest/tests/ProtobufBuilderTest.java | 4 - .../itest/testutil/runner/ProcessorSuite.java | 31 +- .../testutil/runner/ProcessorSuiteRunner.java | 8 +- .../superTypeGenerationTest/generator/pom.xml | 2 - .../superTypeGenerationTest/usage/pom.xml | 2 - .../generator/pom.xml | 2 - .../targetTypeGenerationTest/usage/pom.xml | 2 - parent/pom.xml | 17 +- pom.xml | 1 - 63 files changed, 36 insertions(+), 854 deletions(-) delete mode 100644 core-common/pom.xml delete mode 100644 core-jdk8/src/main/java/org/mapstruct/Mapping.java delete mode 100644 core-jdk8/src/main/java/org/mapstruct/Mappings.java delete mode 100644 core-jdk8/src/main/java/org/mapstruct/ValueMapping.java delete mode 100644 core-jdk8/src/main/java/org/mapstruct/ValueMappings.java rename {core-common => core}/src/main/java/org/mapstruct/AfterMapping.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/BeanMapping.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/BeforeMapping.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/Builder.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/CollectionMappingStrategy.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/Context.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/DecoratedWith.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/InheritConfiguration.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/InheritInverseConfiguration.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/InjectionStrategy.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/IterableMapping.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/MapMapping.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/Mapper.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/MapperConfig.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/MappingConstants.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/MappingInheritanceStrategy.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/MappingTarget.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/Named.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/NullValueCheckStrategy.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/NullValueMappingStrategy.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/ObjectFactory.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/Qualifier.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/ReportingPolicy.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/TargetType.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/factory/Mappers.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/factory/package-info.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/package-info.java (100%) rename {core-common => core}/src/main/java/org/mapstruct/util/Experimental.java (100%) rename {core-common => core}/src/test/java/org/mapstruct/factory/MappersTest.java (100%) rename {core-common => core}/src/test/java/org/mapstruct/factory/PackagePrivateMapper.java (100%) rename {core-common => core}/src/test/java/org/mapstruct/factory/PackagePrivateMapperImpl.java (100%) rename {core-common => core}/src/test/java/org/mapstruct/test/model/Foo.java (100%) rename {core-common => core}/src/test/java/org/mapstruct/test/model/FooImpl.java (100%) rename {core-common => core}/src/test/java/org/mapstruct/test/model/SomeClass$FooImpl.java (100%) rename {core-common => core}/src/test/java/org/mapstruct/test/model/SomeClass$NestedClass$FooImpl.java (100%) rename {core-common => core}/src/test/java/org/mapstruct/test/model/SomeClass.java (100%) diff --git a/core-common/pom.xml b/core-common/pom.xml deleted file mode 100644 index 058307123..000000000 --- a/core-common/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - 4.0.0 - - - org.mapstruct - mapstruct-parent - 1.3.0-SNAPSHOT - ../parent/pom.xml - - - mapstruct-common - jar - MapStruct Core Common - - - true - true - - - - - junit - junit - test - - - org.assertj - assertj-core - test - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - check-style - verify - - checkstyle - - - - - - - diff --git a/core-jdk8/pom.xml b/core-jdk8/pom.xml index 456766be0..48f50c7b6 100644 --- a/core-jdk8/pom.xml +++ b/core-jdk8/pom.xml @@ -17,146 +17,13 @@ mapstruct-jdk8 - jar MapStruct Core JDK 8 - MapStruct annotations to be used with JDK 8 and later + Deprecated MapStruct artifact containing annotations to be used with JDK 8 and later - + Relocated to mapstruct + + + mapstruct + + - - copied-common-sources - - - - - ${project.groupId} - mapstruct-common - true - - - junit - junit - test - - - org.assertj - assertj-core - test - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - check-style - verify - - checkstyle - - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - verify - - jar - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-copied-common-sources - generate-sources - - add-source - - - - ${project.build.directory}/${common.sources.dir} - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-resources - process-resources - - copy-resources - - - ${project.build.directory}/${common.sources.dir} - - - ${basedir}/../core-common/src/main/java - false - - - - - - copy-mapstruct-license - prepare-package - - copy-resources - - - ${project.build.directory}/classes/META-INF - - - ${basedir}/.. - false - LICENSE.txt - - - - - - - - org.apache.felix - maven-bundle-plugin - - - org.mapstruct - - - - - maven-jar-plugin - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - com.github.siom79.japicmp - japicmp-maven-plugin - - - diff --git a/core-jdk8/src/main/java/org/mapstruct/Mapping.java b/core-jdk8/src/main/java/org/mapstruct/Mapping.java deleted file mode 100644 index a5d86dc90..000000000 --- a/core-jdk8/src/main/java/org/mapstruct/Mapping.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright MapStruct Authors. - * - * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 - */ -package org.mapstruct; - -import java.lang.annotation.Annotation; -import java.lang.annotation.ElementType; -import java.lang.annotation.Repeatable; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.text.SimpleDateFormat; -import java.text.DecimalFormat; -import java.util.Date; - -import static org.mapstruct.NullValueCheckStrategy.ON_IMPLICIT_CONVERSION; - -/** - * Configures the mapping of one bean attribute or enum constant. - *

- * The name of the mapped attribute or constant is to be specified via {@link #target()}. For mapped bean attributes it - * is assumed by default that the attribute has the same name in the source bean. Alternatively, one of - * {@link #source()}, {@link #expression()} or {@link #constant()} can be specified to define the property source. - *

- * In addition, the attributes {@link #dateFormat()} and {@link #qualifiedBy()} may be used to further define the - * mapping. - * - *

- * IMPORTANT NOTE: the enum mapping capability is deprecated and replaced by {@link ValueMapping} it - * will be removed in subsequent versions. - * - * @author Gunnar Morling - */ -@Repeatable(Mappings.class) -@Retention(RetentionPolicy.CLASS) -@Target(ElementType.METHOD) -public @interface Mapping { - - /** - * The target name of the configured property as defined by the JavaBeans specification. The same target property - * must not be mapped more than once. - *

- * If used to map an enum constant, the name of the constant member is to be given. In this case, several values - * from the source enum may be mapped to the same value of the target enum. - * - * @return The target name of the configured property or enum constant - */ - String target(); - - /** - * The source to use for this mapping. This can either be: - *

    - *
  1. The source name of the configured property as defined by the JavaBeans specification. - *

    - * This may either be a simple property name (e.g. "address") or a dot-separated property path (e.g. "address.city" - * or "address.city.name"). In case the annotated method has several source parameters, the property name must - * qualified with the parameter name, e.g. "addressParam.city".

  2. - *
  3. When no matching property is found, MapStruct looks for a matching parameter name instead.
  4. - *
  5. When used to map an enum constant, the name of the constant member is to be given.
  6. - *
- * This attribute can not be used together with {@link #constant()} or {@link #expression()}. - * - * @return The source name of the configured property or enum constant. - */ - String source() default ""; - - /** - * A format string as processable by {@link SimpleDateFormat} if the attribute is mapped from {@code String} to - * {@link Date} or vice-versa. Will be ignored for all other attribute types and when mapping enum constants. - * - * @return A date format string as processable by {@link SimpleDateFormat}. - */ - String dateFormat() default ""; - - /** - * A format string as processable by {@link DecimalFormat} if the annotated method maps from a - * {@link Number} to a {@link String} or vice-versa. Will be ignored for all other element types. - * - * @return A decimal format string as processable by {@link DecimalFormat}. - */ - String numberFormat() default ""; - - /** - * A constant {@link String} based on which the specified target property is to be set. - *

- * When the designated target property is of type: - *

- *
    - *
  1. primitive or boxed (e.g. {@code java.lang.Long}). - *

    - * MapStruct checks whether the primitive can be assigned as valid literal to the primitive or boxed type. - *

    - *
      - *
    • - * If possible, MapStruct assigns as literal. - *
    • - *
    • - * If not possible, MapStruct will try to apply a user defined mapping method. - *
    • - *
    - *
  2. - *
  3. other - *

    - * MapStruct handles the constant as {@code String}. The value will be converted by applying a matching method, - * type conversion method or built-in conversion. - *

    - *

  4. - *
- *

- * This attribute can not be used together with {@link #source()}, {@link #defaultValue()}, - * {@link #defaultExpression()} or {@link #expression()}. - * - * @return A constant {@code String} constant specifying the value for the designated target property - */ - String constant() default ""; - - /** - * An expression {@link String} based on which the specified target property is to be set. - *

- * Currently, Java is the only supported "expression language" and expressions must be given in form of Java - * expressions using the following format: {@code java()}. For instance the mapping: - *


-     * @Mapping(
-     *     target = "someProp",
-     *     expression = "java(new TimeAndFormat( s.getTime(), s.getFormat() ))"
-     * )
-     * 
- *

- * will cause the following target property assignment to be generated: - *

- * {@code targetBean.setSomeProp( new TimeAndFormat( s.getTime(), s.getFormat() ) )}. - *

- * Any types referenced in expressions must be given via their fully-qualified name. Alternatively, types can be - * imported via {@link Mapper#imports()}. - *

- * This attribute can not be used together with {@link #source()}, {@link #defaultValue()}, - * {@link #defaultExpression()} or {@link #constant()}. - * - * @return An expression specifying the value for the designated target property - */ - String expression() default ""; - - /** - * A defaultExpression {@link String} based on which the specified target property is to be set - * if and only if the specified source property is null. - *

- * Currently, Java is the only supported "expression language" and expressions must be given in form of Java - * expressions using the following format: {@code java()}. For instance the mapping: - *


-     * @Mapping(
-     *     target = "someProp",
-     *     defaultExpression = "java(new TimeAndFormat( s.getTime(), s.getFormat() ))"
-     * )
-     * 
- *

- * will cause the following target property assignment to be generated: - *

- * {@code targetBean.setSomeProp( new TimeAndFormat( s.getTime(), s.getFormat() ) )}. - *

- * Any types referenced in expressions must be given via their fully-qualified name. Alternatively, types can be - * imported via {@link Mapper#imports()}. - *

- * This attribute can not be used together with {@link #expression()}, {@link #defaultValue()} - * or {@link #constant()}. - * - * @return An expression specifying a defaultValue for the designated target property if the designated source - * property is null - * - * @since 1.3 - */ - String defaultExpression() default ""; - - /** - * Whether the property specified via {@link #target()} should be ignored by the generated mapping method or not. - * This can be useful when certain attributes should not be propagated from source or target or when properties in - * the target object are populated using a decorator and thus would be reported as unmapped target property by - * default. - * - * @return {@code true} if the given property should be ignored, {@code false} otherwise - */ - boolean ignore() default false; - - /** - * A qualifier can be specified to aid the selection process of a suitable mapper. This is useful in case multiple - * mapping methods (hand written or generated) qualify and thus would result in an 'Ambiguous mapping methods found' - * error. A qualifier is a custom annotation and can be placed on a hand written mapper class or a method. - * - * @return the qualifiers - */ - Class[] qualifiedBy() default { }; - - /** - * String-based form of qualifiers; When looking for a suitable mapping method for a given property, MapStruct will - * only consider those methods carrying directly or indirectly (i.e. on the class-level) a {@link Named} annotation - * for each of the specified qualifier names. - *

- * Note that annotation-based qualifiers are generally preferable as they allow more easily to find references and - * are safe for refactorings, but name-based qualifiers can be a less verbose alternative when requiring a large - * number of qualifiers as no custom annotation types are needed. - * - * @return One or more qualifier name(s) - * @see #qualifiedBy() - * @see Named - */ - String[] qualifiedByName() default { }; - - /** - * Specifies the result type of the mapping method to be used in case multiple mapping methods qualify. - * - * @return the resultType to select - */ - Class resultType() default void.class; - - /** - * One or more properties of the result type on which the mapped property depends. The generated method - * implementation will invoke the setters of the result type ordered so that the given dependency relationship(s) - * are satisfied. Useful in case one property setter depends on the state of another property of the result type. - *

- * An error will be raised in case a cycle in the dependency relationships is detected. - * - * @return the dependencies of the mapped property - */ - String[] dependsOn() default { }; - - /** - * In case the source property is {@code null}, the provided default {@link String} value is set. - *

- * When the designated target property is of type: - *

- *
    - *
  1. primitive or boxed (e.g. {@code java.lang.Long}). - *

    - * MapStruct checks whether the primitive can be assigned as valid literal to the primitive or boxed type. - *

    - *
      - *
    • - * If possible, MapStruct assigns as literal. - *
    • - *
    • - * If not possible, MapStruct will try to apply a user defined mapping method. - *
    • - *
    - *
  2. - *
  3. other - *

    - * MapStruct handles the constant as {@code String}. The value will be converted by applying a matching method, - * type conversion method or built-in conversion. - *

    - *

  4. - *
- *

- * This attribute can not be used together with {@link #constant()}, {@link #expression()} - * or {@link #defaultExpression()}. - * - * @return Default value to set in case the source property is {@code null}. - */ - String defaultValue() default ""; - - /** - * Determines when to include a null check on the source property value of a bean mapping. - * - * Can be overridden by the one on {@link MapperConfig}, {@link Mapper} or {@link BeanMapping}. - * - * @return strategy how to do null checking - */ - NullValueCheckStrategy nullValueCheckStrategy() default ON_IMPLICIT_CONVERSION; - -} diff --git a/core-jdk8/src/main/java/org/mapstruct/Mappings.java b/core-jdk8/src/main/java/org/mapstruct/Mappings.java deleted file mode 100644 index 1e9dd9670..000000000 --- a/core-jdk8/src/main/java/org/mapstruct/Mappings.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright MapStruct Authors. - * - * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 - */ -package org.mapstruct; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Configures the mappings of several bean attributes. - * - * @author Gunnar Morling - */ -@Retention(RetentionPolicy.CLASS) -@Target(ElementType.METHOD) -public @interface Mappings { - - /** - * The configuration of the bean attributes. - * - * @return The configuration of the bean attributes. - */ - Mapping[] value(); -} diff --git a/core-jdk8/src/main/java/org/mapstruct/ValueMapping.java b/core-jdk8/src/main/java/org/mapstruct/ValueMapping.java deleted file mode 100644 index 26ed661dc..000000000 --- a/core-jdk8/src/main/java/org/mapstruct/ValueMapping.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright MapStruct Authors. - * - * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 - */ -package org.mapstruct; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Repeatable; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Configures the mapping of source constant value to target constant value. - *

- * Supported mappings are - *

    - *
  1. Enumeration to Enumeration
  2. - *
- *

- * Example 1: - * - *

- * 
- * public enum OrderType { RETAIL, B2B, EXTRA, STANDARD, NORMAL }
- *
- * public enum ExternalOrderType { RETAIL, B2B, SPECIAL, DEFAULT }
- *
- * @ValueMapping(source = "EXTRA", target = "SPECIAL"),
- * @ValueMapping(source = "STANDARD", target = "DEFAULT"),
- * @ValueMapping(source = "NORMAL", target = "DEFAULT")
- * ExternalOrderType orderTypeToExternalOrderType(OrderType orderType);
- * 
- * Mapping result:
- * +---------------------+----------------------------+
- * | OrderType           | ExternalOrderType          |
- * +---------------------+----------------------------+
- * | null                | null                       |
- * | OrderType.EXTRA     | ExternalOrderType.SPECIAL  |
- * | OrderType.STANDARD  | ExternalOrderType.DEFAULT  |
- * | OrderType.NORMAL    | ExternalOrderType.DEFAULT  |
- * | OrderType.RETAIL    | ExternalOrderType.RETAIL   |
- * | OrderType.B2B       | ExternalOrderType.B2B      |
- * +---------------------+----------------------------+
- * 
- * - * MapStruct will WARN on incomplete mappings. However, if for some reason no match is found an - * {@link java.lang.IllegalStateException} will be thrown. - *

- * Example 2: - * - *

- * 
- * @ValueMapping( source = MappingConstants.NULL, target = "DEFAULT" ),
- * @ValueMapping( source = "STANDARD", target = MappingConstants.NULL ),
- * @ValueMapping( source = MappingConstants.ANY_REMAINING, target = "SPECIAL" )
- * ExternalOrderType orderTypeToExternalOrderType(OrderType orderType);
- * 
- * Mapping result:
- * +---------------------+----------------------------+
- * | OrderType           | ExternalOrderType          |
- * +---------------------+----------------------------+
- * | null                | ExternalOrderType.DEFAULT  |
- * | OrderType.STANDARD  | null                       |
- * | OrderType.RETAIL    | ExternalOrderType.RETAIL   |
- * | OrderType.B2B       | ExternalOrderType.B2B      |
- * | OrderType.NORMAL    | ExternalOrderType.SPECIAL  |
- * | OrderType.EXTRA     | ExternalOrderType.SPECIAL  |
- * +---------------------+----------------------------+
- * 
- * - * @author Sjaak Derksen - */ -@Repeatable(ValueMappings.class) -@Retention(RetentionPolicy.CLASS) -@Target(ElementType.METHOD) -public @interface ValueMapping { - /** - * The source value constant to use for this mapping. - * - *

- * Valid values: - *

    - *
  1. enum constant name
  2. - *
  3. {@link MappingConstants#NULL}
  4. - *
  5. {@link MappingConstants#ANY_REMAINING}
  6. - *
  7. {@link MappingConstants#ANY_UNMAPPED}
  8. - *
- *

- * NOTE:When using <ANY_REMAINING>, MapStruct will perform the normal name based mapping, in which - * source is mapped to target based on enum identifier equality. Using <ANY_UNMAPPED> will not apply name - * based mapping. - * - * @return The source value. - */ - String source(); - - /** - * The target value constant to use for this mapping. - * - *

- * Valid values: - *

    - *
  1. enum constant name
  2. - *
  3. {@link MappingConstants#NULL}
  4. - *
- * - * @return The target value. - */ - String target(); - -} diff --git a/core-jdk8/src/main/java/org/mapstruct/ValueMappings.java b/core-jdk8/src/main/java/org/mapstruct/ValueMappings.java deleted file mode 100644 index f2450a2fd..000000000 --- a/core-jdk8/src/main/java/org/mapstruct/ValueMappings.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright MapStruct Authors. - * - * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 - */ -package org.mapstruct; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Constructs a set of value (constant) mappings. - * - * @author Sjaak Derksen - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.CLASS) -public @interface ValueMappings { - - ValueMapping[] value(); - -} diff --git a/core/pom.xml b/core/pom.xml index f6b037f6e..b566ffe05 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -20,10 +20,6 @@ jar MapStruct Core - - copied-common-sources - - ${project.groupId} @@ -70,44 +66,10 @@ - - org.codehaus.mojo - build-helper-maven-plugin - - - add-copied-common-sources - generate-sources - - add-source - - - - ${project.build.directory}/${common.sources.dir} - - - - - org.apache.maven.plugins maven-resources-plugin - - copy-resources - process-resources - - copy-resources - - - ${project.build.directory}/${common.sources.dir} - - - ${basedir}/../core-common/src/main/java - false - - - - copy-mapstruct-license prepare-package diff --git a/core-common/src/main/java/org/mapstruct/AfterMapping.java b/core/src/main/java/org/mapstruct/AfterMapping.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/AfterMapping.java rename to core/src/main/java/org/mapstruct/AfterMapping.java diff --git a/core-common/src/main/java/org/mapstruct/BeanMapping.java b/core/src/main/java/org/mapstruct/BeanMapping.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/BeanMapping.java rename to core/src/main/java/org/mapstruct/BeanMapping.java diff --git a/core-common/src/main/java/org/mapstruct/BeforeMapping.java b/core/src/main/java/org/mapstruct/BeforeMapping.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/BeforeMapping.java rename to core/src/main/java/org/mapstruct/BeforeMapping.java diff --git a/core-common/src/main/java/org/mapstruct/Builder.java b/core/src/main/java/org/mapstruct/Builder.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/Builder.java rename to core/src/main/java/org/mapstruct/Builder.java diff --git a/core-common/src/main/java/org/mapstruct/CollectionMappingStrategy.java b/core/src/main/java/org/mapstruct/CollectionMappingStrategy.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/CollectionMappingStrategy.java rename to core/src/main/java/org/mapstruct/CollectionMappingStrategy.java diff --git a/core-common/src/main/java/org/mapstruct/Context.java b/core/src/main/java/org/mapstruct/Context.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/Context.java rename to core/src/main/java/org/mapstruct/Context.java diff --git a/core-common/src/main/java/org/mapstruct/DecoratedWith.java b/core/src/main/java/org/mapstruct/DecoratedWith.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/DecoratedWith.java rename to core/src/main/java/org/mapstruct/DecoratedWith.java diff --git a/core-common/src/main/java/org/mapstruct/InheritConfiguration.java b/core/src/main/java/org/mapstruct/InheritConfiguration.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/InheritConfiguration.java rename to core/src/main/java/org/mapstruct/InheritConfiguration.java diff --git a/core-common/src/main/java/org/mapstruct/InheritInverseConfiguration.java b/core/src/main/java/org/mapstruct/InheritInverseConfiguration.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/InheritInverseConfiguration.java rename to core/src/main/java/org/mapstruct/InheritInverseConfiguration.java diff --git a/core-common/src/main/java/org/mapstruct/InjectionStrategy.java b/core/src/main/java/org/mapstruct/InjectionStrategy.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/InjectionStrategy.java rename to core/src/main/java/org/mapstruct/InjectionStrategy.java diff --git a/core-common/src/main/java/org/mapstruct/IterableMapping.java b/core/src/main/java/org/mapstruct/IterableMapping.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/IterableMapping.java rename to core/src/main/java/org/mapstruct/IterableMapping.java diff --git a/core-common/src/main/java/org/mapstruct/MapMapping.java b/core/src/main/java/org/mapstruct/MapMapping.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/MapMapping.java rename to core/src/main/java/org/mapstruct/MapMapping.java diff --git a/core-common/src/main/java/org/mapstruct/Mapper.java b/core/src/main/java/org/mapstruct/Mapper.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/Mapper.java rename to core/src/main/java/org/mapstruct/Mapper.java diff --git a/core-common/src/main/java/org/mapstruct/MapperConfig.java b/core/src/main/java/org/mapstruct/MapperConfig.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/MapperConfig.java rename to core/src/main/java/org/mapstruct/MapperConfig.java diff --git a/core/src/main/java/org/mapstruct/Mapping.java b/core/src/main/java/org/mapstruct/Mapping.java index edf7d55ec..b6a4dc87e 100644 --- a/core/src/main/java/org/mapstruct/Mapping.java +++ b/core/src/main/java/org/mapstruct/Mapping.java @@ -7,15 +7,15 @@ package org.mapstruct; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; +import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import java.text.SimpleDateFormat; import java.text.DecimalFormat; +import java.text.SimpleDateFormat; import java.util.Date; import static org.mapstruct.NullValueCheckStrategy.ON_IMPLICIT_CONVERSION; - /** * Configures the mapping of one bean attribute or enum constant. *

@@ -32,6 +32,8 @@ import static org.mapstruct.NullValueCheckStrategy.ON_IMPLICIT_CONVERSION; * * @author Gunnar Morling */ + +@Repeatable(Mappings.class) @Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface Mapping { @@ -98,9 +100,6 @@ public @interface Mapping { * If not possible, MapStruct will try to apply a user defined mapping method. * * - *

- * Please note that grouping underscores and binary literals are not supported in Java 6 - *

* *
  • other *

    @@ -207,7 +206,6 @@ public @interface Mapping { */ String[] qualifiedByName() default { }; - /** * Specifies the result type of the mapping method to be used in case multiple mapping methods qualify. * @@ -244,9 +242,6 @@ public @interface Mapping { * If not possible, MapStruct will try to apply a user defined mapping method. *

  • * - *

    - * Please note that grouping underscores and binary literals are not supported in Java 6 - *

    * *
  • other *

    diff --git a/core-common/src/main/java/org/mapstruct/MappingConstants.java b/core/src/main/java/org/mapstruct/MappingConstants.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/MappingConstants.java rename to core/src/main/java/org/mapstruct/MappingConstants.java diff --git a/core-common/src/main/java/org/mapstruct/MappingInheritanceStrategy.java b/core/src/main/java/org/mapstruct/MappingInheritanceStrategy.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/MappingInheritanceStrategy.java rename to core/src/main/java/org/mapstruct/MappingInheritanceStrategy.java diff --git a/core-common/src/main/java/org/mapstruct/MappingTarget.java b/core/src/main/java/org/mapstruct/MappingTarget.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/MappingTarget.java rename to core/src/main/java/org/mapstruct/MappingTarget.java diff --git a/core-common/src/main/java/org/mapstruct/Named.java b/core/src/main/java/org/mapstruct/Named.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/Named.java rename to core/src/main/java/org/mapstruct/Named.java diff --git a/core-common/src/main/java/org/mapstruct/NullValueCheckStrategy.java b/core/src/main/java/org/mapstruct/NullValueCheckStrategy.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/NullValueCheckStrategy.java rename to core/src/main/java/org/mapstruct/NullValueCheckStrategy.java diff --git a/core-common/src/main/java/org/mapstruct/NullValueMappingStrategy.java b/core/src/main/java/org/mapstruct/NullValueMappingStrategy.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/NullValueMappingStrategy.java rename to core/src/main/java/org/mapstruct/NullValueMappingStrategy.java diff --git a/core-common/src/main/java/org/mapstruct/ObjectFactory.java b/core/src/main/java/org/mapstruct/ObjectFactory.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/ObjectFactory.java rename to core/src/main/java/org/mapstruct/ObjectFactory.java diff --git a/core-common/src/main/java/org/mapstruct/Qualifier.java b/core/src/main/java/org/mapstruct/Qualifier.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/Qualifier.java rename to core/src/main/java/org/mapstruct/Qualifier.java diff --git a/core-common/src/main/java/org/mapstruct/ReportingPolicy.java b/core/src/main/java/org/mapstruct/ReportingPolicy.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/ReportingPolicy.java rename to core/src/main/java/org/mapstruct/ReportingPolicy.java diff --git a/core-common/src/main/java/org/mapstruct/TargetType.java b/core/src/main/java/org/mapstruct/TargetType.java similarity index 100% rename from core-common/src/main/java/org/mapstruct/TargetType.java rename to core/src/main/java/org/mapstruct/TargetType.java diff --git a/core/src/main/java/org/mapstruct/ValueMapping.java b/core/src/main/java/org/mapstruct/ValueMapping.java index f677fb103..26ed661dc 100644 --- a/core/src/main/java/org/mapstruct/ValueMapping.java +++ b/core/src/main/java/org/mapstruct/ValueMapping.java @@ -6,6 +6,7 @@ package org.mapstruct; import java.lang.annotation.ElementType; +import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @@ -26,11 +27,9 @@ import java.lang.annotation.Target; * * public enum ExternalOrderType { RETAIL, B2B, SPECIAL, DEFAULT } * - * @ValueMappings({ - * @ValueMapping(source = "EXTRA", target = "SPECIAL"), - * @ValueMapping(source = "STANDARD", target = "DEFAULT"), - * @ValueMapping(source = "NORMAL", target = "DEFAULT") - * }) + * @ValueMapping(source = "EXTRA", target = "SPECIAL"), + * @ValueMapping(source = "STANDARD", target = "DEFAULT"), + * @ValueMapping(source = "NORMAL", target = "DEFAULT") * ExternalOrderType orderTypeToExternalOrderType(OrderType orderType); * * Mapping result: @@ -53,11 +52,9 @@ import java.lang.annotation.Target; * *

      * 
    - * @ValueMappings({
    - *    @ValueMapping( source = MappingConstants.NULL, target = "DEFAULT" ),
    - *    @ValueMapping( source = "STANDARD", target = MappingConstants.NULL ),
    - *    @ValueMapping( source = MappingConstants.ANY_REMAINING, target = "SPECIAL" )
    - * })
    + * @ValueMapping( source = MappingConstants.NULL, target = "DEFAULT" ),
    + * @ValueMapping( source = "STANDARD", target = MappingConstants.NULL ),
    + * @ValueMapping( source = MappingConstants.ANY_REMAINING, target = "SPECIAL" )
      * ExternalOrderType orderTypeToExternalOrderType(OrderType orderType);
      * 
      * Mapping result:
    @@ -75,10 +72,10 @@ import java.lang.annotation.Target;
      *
      * @author Sjaak Derksen
      */
    +@Repeatable(ValueMappings.class)
     @Retention(RetentionPolicy.CLASS)
     @Target(ElementType.METHOD)
     public @interface ValueMapping {
    -
         /**
          * The source value constant to use for this mapping.
          *
    diff --git a/core-common/src/main/java/org/mapstruct/factory/Mappers.java b/core/src/main/java/org/mapstruct/factory/Mappers.java
    similarity index 100%
    rename from core-common/src/main/java/org/mapstruct/factory/Mappers.java
    rename to core/src/main/java/org/mapstruct/factory/Mappers.java
    diff --git a/core-common/src/main/java/org/mapstruct/factory/package-info.java b/core/src/main/java/org/mapstruct/factory/package-info.java
    similarity index 100%
    rename from core-common/src/main/java/org/mapstruct/factory/package-info.java
    rename to core/src/main/java/org/mapstruct/factory/package-info.java
    diff --git a/core-common/src/main/java/org/mapstruct/package-info.java b/core/src/main/java/org/mapstruct/package-info.java
    similarity index 100%
    rename from core-common/src/main/java/org/mapstruct/package-info.java
    rename to core/src/main/java/org/mapstruct/package-info.java
    diff --git a/core-common/src/main/java/org/mapstruct/util/Experimental.java b/core/src/main/java/org/mapstruct/util/Experimental.java
    similarity index 100%
    rename from core-common/src/main/java/org/mapstruct/util/Experimental.java
    rename to core/src/main/java/org/mapstruct/util/Experimental.java
    diff --git a/core-common/src/test/java/org/mapstruct/factory/MappersTest.java b/core/src/test/java/org/mapstruct/factory/MappersTest.java
    similarity index 100%
    rename from core-common/src/test/java/org/mapstruct/factory/MappersTest.java
    rename to core/src/test/java/org/mapstruct/factory/MappersTest.java
    diff --git a/core-common/src/test/java/org/mapstruct/factory/PackagePrivateMapper.java b/core/src/test/java/org/mapstruct/factory/PackagePrivateMapper.java
    similarity index 100%
    rename from core-common/src/test/java/org/mapstruct/factory/PackagePrivateMapper.java
    rename to core/src/test/java/org/mapstruct/factory/PackagePrivateMapper.java
    diff --git a/core-common/src/test/java/org/mapstruct/factory/PackagePrivateMapperImpl.java b/core/src/test/java/org/mapstruct/factory/PackagePrivateMapperImpl.java
    similarity index 100%
    rename from core-common/src/test/java/org/mapstruct/factory/PackagePrivateMapperImpl.java
    rename to core/src/test/java/org/mapstruct/factory/PackagePrivateMapperImpl.java
    diff --git a/core-common/src/test/java/org/mapstruct/test/model/Foo.java b/core/src/test/java/org/mapstruct/test/model/Foo.java
    similarity index 100%
    rename from core-common/src/test/java/org/mapstruct/test/model/Foo.java
    rename to core/src/test/java/org/mapstruct/test/model/Foo.java
    diff --git a/core-common/src/test/java/org/mapstruct/test/model/FooImpl.java b/core/src/test/java/org/mapstruct/test/model/FooImpl.java
    similarity index 100%
    rename from core-common/src/test/java/org/mapstruct/test/model/FooImpl.java
    rename to core/src/test/java/org/mapstruct/test/model/FooImpl.java
    diff --git a/core-common/src/test/java/org/mapstruct/test/model/SomeClass$FooImpl.java b/core/src/test/java/org/mapstruct/test/model/SomeClass$FooImpl.java
    similarity index 100%
    rename from core-common/src/test/java/org/mapstruct/test/model/SomeClass$FooImpl.java
    rename to core/src/test/java/org/mapstruct/test/model/SomeClass$FooImpl.java
    diff --git a/core-common/src/test/java/org/mapstruct/test/model/SomeClass$NestedClass$FooImpl.java b/core/src/test/java/org/mapstruct/test/model/SomeClass$NestedClass$FooImpl.java
    similarity index 100%
    rename from core-common/src/test/java/org/mapstruct/test/model/SomeClass$NestedClass$FooImpl.java
    rename to core/src/test/java/org/mapstruct/test/model/SomeClass$NestedClass$FooImpl.java
    diff --git a/core-common/src/test/java/org/mapstruct/test/model/SomeClass.java b/core/src/test/java/org/mapstruct/test/model/SomeClass.java
    similarity index 100%
    rename from core-common/src/test/java/org/mapstruct/test/model/SomeClass.java
    rename to core/src/test/java/org/mapstruct/test/model/SomeClass.java
    diff --git a/distribution/pom.xml b/distribution/pom.xml
    index b586a4ba2..4645262fd 100644
    --- a/distribution/pom.xml
    +++ b/distribution/pom.xml
    @@ -25,10 +25,6 @@
                 org.mapstruct
                 mapstruct
             
    -        
    -            org.mapstruct
    -            mapstruct-jdk8
    -        
             
                 org.mapstruct
                 mapstruct-processor
    @@ -82,7 +78,6 @@
                     maven-javadoc-plugin
                     
                         
    -                        ${basedir}/../core-common/src/main/java;
                             ${basedir}/../core/src/main/java;
                             ${basedir}/../processor/src/main/java
                         
    diff --git a/distribution/src/main/assembly/dist.xml b/distribution/src/main/assembly/dist.xml
    index 6dee9eeda..f519e5fc9 100644
    --- a/distribution/src/main/assembly/dist.xml
    +++ b/distribution/src/main/assembly/dist.xml
    @@ -19,7 +19,6 @@
                 lib
                 
                     org.mapstruct:mapstruct
    -                org.mapstruct:mapstruct-jdk8
                     org.mapstruct:mapstruct-processor
                 
             
    diff --git a/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc b/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc
    index 0f66e90d1..56f629175 100644
    --- a/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc
    +++ b/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc
    @@ -44,7 +44,7 @@ MapStruct is a Java annotation processor based on http://www.jcp.org/en/jsr/deta
     
     It comprises the following artifacts:
     
    -* _org.mapstruct:mapstruct_: contains the required annotations such as `@Mapping`; On Java 8 or later, use _org.mapstruct:mapstruct-jdk8_ instead which takes advantage of language improvements introduced in Java 8
    +* _org.mapstruct:mapstruct_: contains the required annotations such as `@Mapping`
     * _org.mapstruct:mapstruct-processor_: contains the annotation processor which generates mapper implementations
     
     === Apache Maven
    @@ -64,7 +64,7 @@ For Maven based projects add the following to your POM file in order to use MapS
     
         
             org.mapstruct
    -        mapstruct-jdk8
    +        mapstruct
             ${org.mapstruct.version}
         
     
    @@ -107,7 +107,7 @@ If the processor is not kicking in, check that the configuration of annotation p
     To do so, go to "Preferences" -> "Maven" -> "Annotation Processing" and select "Automatically configure JDT APT".
     Alternatively, specify the following in the `properties` section of your POM file: `jdt_apt`.
     
    -Also make sure that your project is using Java 1.6 or later (project properties -> "Java Compiler" -> "Compile Compliance Level").
    +Also make sure that your project is using Java 1.8 or later (project properties -> "Java Compiler" -> "Compile Compliance Level").
     It will not work with older versions.
     ====
     
    @@ -133,7 +133,7 @@ apply plugin: 'net.ltgt.apt-eclipse'
     
     dependencies {
         ...
    -    compile "org.mapstruct:mapstruct-jdk8:${mapstructVersion}"
    +    compile "org.mapstruct:mapstruct:${mapstructVersion}"
     
         annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
         // If you are using mapstruct in test code
    @@ -159,7 +159,7 @@ Add the `javac` task configured as follows to your _build.xml_ file in order to
     
    +    classpath="path/to/mapstruct-{mapstructVersion}.jar">
         
         
     
    @@ -347,10 +347,6 @@ public Builder seatCount(int seatCount) {
     ```
     ====
     
    -[TIP]
    -====
    -When using Java 8 or later, you can omit the `@Mappings` wrapper annotation and directly specify several `@Mapping` annotations on one method.
    -====
     
     To get a better understanding of what MapStruct does have a look at the following implementation of the `carToCarDto()` method as generated by MapStruct:
     
    diff --git a/etc/toolchains-cloudbees-jenkins.xml b/etc/toolchains-cloudbees-jenkins.xml
    index e6ce86e06..cf7f0262f 100644
    --- a/etc/toolchains-cloudbees-jenkins.xml
    +++ b/etc/toolchains-cloudbees-jenkins.xml
    @@ -1,27 +1,5 @@
     
     
    -    
    -        jdk
    -        
    -            1.6
    -            oracle
    -            jdk1.6
    -        
    -        
    -            /opt/jdk/jdk1.6.latest
    -        
    -    
    -    
    -        jdk
    -        
    -            1.7
    -            oracle
    -            jdk1.7
    -        
    -        
    -            /opt/jdk/jdk1.7.latest
    -        
    -    
         
             jdk
             
    @@ -33,5 +11,4 @@
                 /opt/jdk/jdk8.latest
             
         
    -    
     
    diff --git a/etc/toolchains-example.xml b/etc/toolchains-example.xml
    index 08cee8b24..628487ce0 100644
    --- a/etc/toolchains-example.xml
    +++ b/etc/toolchains-example.xml
    @@ -1,27 +1,5 @@
     
     
    -    
    -        jdk
    -        
    -            1.6.0_45
    -            oracle
    -            jdk1.6
    -        
    -        
    -            C:\Program Files\Java\jdk1.6.0_45
    -        
    -    
    -    
    -        jdk
    -        
    -            1.7.0_51
    -            oracle
    -            jdk1.7
    -        
    -        
    -            C:\Program Files\Java\jdk1.7.0_51
    -        
    -    
         
             jdk
             
    diff --git a/etc/toolchains-travis-jenkins.xml b/etc/toolchains-travis-jenkins.xml
    index 75ac0de57..0668c72b9 100644
    --- a/etc/toolchains-travis-jenkins.xml
    +++ b/etc/toolchains-travis-jenkins.xml
    @@ -1,27 +1,6 @@
     
     
    -    
    -        jdk
    -        
    -            1.6
    -            oracle
    -            jdk1.6
    -        
    -        
    -            /usr/lib/jvm/java-6-openjdk-amd64/
    -        
    -    
    -    
    -        jdk
    -        
    -            1.7
    -            oracle
    -            jdk1.7
    -        
    -        
    -            /usr/lib/jvm/java-7-openjdk-amd64/
    -        
    -    
    +
         
             jdk
             
    diff --git a/integrationtest/pom.xml b/integrationtest/pom.xml
    index 820ba733f..18082e0a0 100644
    --- a/integrationtest/pom.xml
    +++ b/integrationtest/pom.xml
    @@ -59,14 +59,6 @@
                         \
                     
                 
    -            
    -                org.apache.maven.plugins
    -                maven-compiler-plugin
    -                
    -                    1.8
    -                    1.8
    -                
    -            
                 
                     org.apache.maven.plugins
                     maven-surefire-plugin
    diff --git a/integrationtest/src/test/java/org/mapstruct/itest/tests/FullFeatureCompilationTest.java b/integrationtest/src/test/java/org/mapstruct/itest/tests/FullFeatureCompilationTest.java
    index ba73357dc..fe3836e30 100644
    --- a/integrationtest/src/test/java/org/mapstruct/itest/tests/FullFeatureCompilationTest.java
    +++ b/integrationtest/src/test/java/org/mapstruct/itest/tests/FullFeatureCompilationTest.java
    @@ -34,12 +34,8 @@ import org.mapstruct.itest.testutil.runner.ProcessorSuiteRunner;
         baseDir = "fullFeatureTest",
         commandLineEnhancer = CompilationExclusionCliEnhancer.class,
         processorTypes = {
    -        ProcessorType.ORACLE_JAVA_6,
    -        ProcessorType.ORACLE_JAVA_7,
             ProcessorType.ORACLE_JAVA_8,
             ProcessorType.ORACLE_JAVA_9,
    -        ProcessorType.ECLIPSE_JDT_JAVA_6,
    -        ProcessorType.ECLIPSE_JDT_JAVA_7,
             ProcessorType.ECLIPSE_JDT_JAVA_8
     })
     public class FullFeatureCompilationTest {
    @@ -57,15 +53,6 @@ public class FullFeatureCompilationTest {
                 additionalExcludes.add( "org/mapstruct/ap/test/bugs/_1596/*.java" );
     
                 switch ( processorType ) {
    -                case ORACLE_JAVA_6:
    -                    additionalExcludes.add( "org/mapstruct/ap/test/abstractclass/generics/*.java" );
    -                    additionalExcludes.add( "org/mapstruct/ap/test/bugs/_1170/*.java" );
    -                case ECLIPSE_JDT_JAVA_6:
    -                case ORACLE_JAVA_7:
    -                case ECLIPSE_JDT_JAVA_7:
    -                    additionalExcludes.add( "org/mapstruct/ap/test/bugs/_1425/*.java" );
    -                    additionalExcludes.add( "**/java8*/**/*.java" );
    -                    break;
                     case ORACLE_JAVA_9:
                         // TODO find out why this fails:
                         additionalExcludes.add( "org/mapstruct/ap/test/collection/wildcard/BeanMapper.java" );
    diff --git a/integrationtest/src/test/java/org/mapstruct/itest/tests/LombokBuilderTest.java b/integrationtest/src/test/java/org/mapstruct/itest/tests/LombokBuilderTest.java
    index ff5ef418b..7199cb1f3 100644
    --- a/integrationtest/src/test/java/org/mapstruct/itest/tests/LombokBuilderTest.java
    +++ b/integrationtest/src/test/java/org/mapstruct/itest/tests/LombokBuilderTest.java
    @@ -15,8 +15,6 @@ import org.mapstruct.itest.testutil.runner.ProcessorSuiteRunner;
     @RunWith( ProcessorSuiteRunner.class )
     @ProcessorSuite( baseDir = "lombokBuilderTest",
         processorTypes = {
    -        ProcessorSuite.ProcessorType.ORACLE_JAVA_6,
    -        ProcessorSuite.ProcessorType.ORACLE_JAVA_7,
             ProcessorSuite.ProcessorType.ORACLE_JAVA_8,
             ProcessorSuite.ProcessorType.ORACLE_JAVA_9,
         }
    diff --git a/integrationtest/src/test/java/org/mapstruct/itest/tests/ProtobufBuilderTest.java b/integrationtest/src/test/java/org/mapstruct/itest/tests/ProtobufBuilderTest.java
    index 7e52bed06..cf648ca3c 100644
    --- a/integrationtest/src/test/java/org/mapstruct/itest/tests/ProtobufBuilderTest.java
    +++ b/integrationtest/src/test/java/org/mapstruct/itest/tests/ProtobufBuilderTest.java
    @@ -17,12 +17,8 @@ import org.mapstruct.itest.testutil.runner.ProcessorSuiteRunner;
     @RunWith(ProcessorSuiteRunner.class)
     @ProcessorSuite(baseDir = "protobufBuilderTest",
         processorTypes = {
    -        ProcessorSuite.ProcessorType.ORACLE_JAVA_6,
    -        ProcessorSuite.ProcessorType.ORACLE_JAVA_7,
             ProcessorSuite.ProcessorType.ORACLE_JAVA_8,
             ProcessorSuite.ProcessorType.ORACLE_JAVA_9,
    -        ProcessorSuite.ProcessorType.ECLIPSE_JDT_JAVA_6,
    -        ProcessorSuite.ProcessorType.ECLIPSE_JDT_JAVA_7
         })
     public class ProtobufBuilderTest {
     }
    diff --git a/integrationtest/src/test/java/org/mapstruct/itest/testutil/runner/ProcessorSuite.java b/integrationtest/src/test/java/org/mapstruct/itest/testutil/runner/ProcessorSuite.java
    index 96f3aa00d..916d51395 100644
    --- a/integrationtest/src/test/java/org/mapstruct/itest/testutil/runner/ProcessorSuite.java
    +++ b/integrationtest/src/test/java/org/mapstruct/itest/testutil/runner/ProcessorSuite.java
    @@ -5,6 +5,8 @@
      */
     package org.mapstruct.itest.testutil.runner;
     
    +import org.apache.maven.it.Verifier;
    +
     import java.lang.annotation.Documented;
     import java.lang.annotation.ElementType;
     import java.lang.annotation.Retention;
    @@ -12,8 +14,6 @@ import java.lang.annotation.RetentionPolicy;
     import java.lang.annotation.Target;
     import java.util.Collection;
     
    -import org.apache.maven.it.Verifier;
    -
     /**
      * Declares the content of the integration test.
      * 

    @@ -39,15 +39,6 @@ public @interface ProcessorSuite { * @author Andreas Gudian */ enum ProcessorType { - /** - * Use an Oracle JDK 1.6 (or 1.6.x) via toolchain support to perform the processing - */ - ORACLE_JAVA_6( new Toolchain( "oracle", "1.6", "1.7" ), "javac", "1.6" ), - - /** - * Use an Oracle JDK 1.7 (or 1.7.x) via toolchain support to perform the processing - */ - ORACLE_JAVA_7( new Toolchain( "oracle", "1.7", "1.8" ), "javac", "1.7" ), /** * Use the same JDK that runs the mvn build to perform the processing @@ -59,18 +50,6 @@ public @interface ProcessorSuite { */ ORACLE_JAVA_9( new Toolchain( "oracle", "9", "10" ), "javac", "1.9" ), - /** - * Use the eclipse compiler with 1.6 source/target level from tycho-compiler-jdt to perform the build and - * processing - */ - ECLIPSE_JDT_JAVA_6( null, "jdt", "1.6" ), - - /** - * Use the eclipse compiler with 1.7 source/target level from tycho-compiler-jdt to perform the build and - * processing - */ - ECLIPSE_JDT_JAVA_7( null, "jdt", "1.7" ), - /** * Use the eclipse compiler with 1.8 source/target level from tycho-compiler-jdt to perform the build and * processing @@ -86,14 +65,12 @@ public @interface ProcessorSuite { /** * Use all processing variants, but without the maven-procesor-plugin */ - ALL_WITHOUT_PROCESSOR_PLUGIN(ORACLE_JAVA_6, ORACLE_JAVA_7, ORACLE_JAVA_8, ORACLE_JAVA_9, ECLIPSE_JDT_JAVA_6, - ECLIPSE_JDT_JAVA_7, ECLIPSE_JDT_JAVA_8), + ALL_WITHOUT_PROCESSOR_PLUGIN( ORACLE_JAVA_8, ORACLE_JAVA_9, ECLIPSE_JDT_JAVA_8), /** * Use all available processing variants */ - ALL( ORACLE_JAVA_6, ORACLE_JAVA_7, ORACLE_JAVA_8, ORACLE_JAVA_9, ECLIPSE_JDT_JAVA_6, ECLIPSE_JDT_JAVA_7, - ECLIPSE_JDT_JAVA_8, PROCESSOR_PLUGIN_JAVA_8 ), + ALL( ORACLE_JAVA_8, ORACLE_JAVA_9, ECLIPSE_JDT_JAVA_8, PROCESSOR_PLUGIN_JAVA_8 ), /** * Use all JDK8 compatible processing variants diff --git a/integrationtest/src/test/java/org/mapstruct/itest/testutil/runner/ProcessorSuiteRunner.java b/integrationtest/src/test/java/org/mapstruct/itest/testutil/runner/ProcessorSuiteRunner.java index 92f02abf7..c2d20e056 100644 --- a/integrationtest/src/test/java/org/mapstruct/itest/testutil/runner/ProcessorSuiteRunner.java +++ b/integrationtest/src/test/java/org/mapstruct/itest/testutil/runner/ProcessorSuiteRunner.java @@ -200,13 +200,7 @@ public class ProcessorSuiteRunner extends ParentRunner { verifier.addCliOption( "-Dcompiler-source-target-version=" + child.processor.getSourceTargetVersion() ); - if ( "1.8".equals( child.processor.getSourceTargetVersion() ) - || "1.9".equals( child.processor.getSourceTargetVersion() ) ) { - verifier.addCliOption( "-Dmapstruct-artifact-id=mapstruct-jdk8" ); - } - else { - verifier.addCliOption( "-Dmapstruct-artifact-id=mapstruct" ); - } + verifier.addCliOption( "-Dmapstruct-artifact-id=mapstruct" ); if ( Boolean.getBoolean( SYS_PROP_DEBUG ) ) { originalOut.print( "Processor Integration Test: " ); diff --git a/integrationtest/src/test/resources/superTypeGenerationTest/generator/pom.xml b/integrationtest/src/test/resources/superTypeGenerationTest/generator/pom.xml index 234a321b1..1b84638ef 100644 --- a/integrationtest/src/test/resources/superTypeGenerationTest/generator/pom.xml +++ b/integrationtest/src/test/resources/superTypeGenerationTest/generator/pom.xml @@ -34,8 +34,6 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 -proc:none diff --git a/integrationtest/src/test/resources/superTypeGenerationTest/usage/pom.xml b/integrationtest/src/test/resources/superTypeGenerationTest/usage/pom.xml index 8cdd33fec..07e89a980 100644 --- a/integrationtest/src/test/resources/superTypeGenerationTest/usage/pom.xml +++ b/integrationtest/src/test/resources/superTypeGenerationTest/usage/pom.xml @@ -41,8 +41,6 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 -XprintProcessorInfo -XprintRounds diff --git a/integrationtest/src/test/resources/targetTypeGenerationTest/generator/pom.xml b/integrationtest/src/test/resources/targetTypeGenerationTest/generator/pom.xml index 60f50ac61..bf0d70485 100644 --- a/integrationtest/src/test/resources/targetTypeGenerationTest/generator/pom.xml +++ b/integrationtest/src/test/resources/targetTypeGenerationTest/generator/pom.xml @@ -34,8 +34,6 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 -proc:none diff --git a/integrationtest/src/test/resources/targetTypeGenerationTest/usage/pom.xml b/integrationtest/src/test/resources/targetTypeGenerationTest/usage/pom.xml index 5aa83327c..8b0852ff0 100644 --- a/integrationtest/src/test/resources/targetTypeGenerationTest/usage/pom.xml +++ b/integrationtest/src/test/resources/targetTypeGenerationTest/usage/pom.xml @@ -41,8 +41,6 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 -XprintProcessorInfo -XprintRounds diff --git a/parent/pom.xml b/parent/pom.xml index 332ab2ff2..5bdd07ce7 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -242,11 +242,6 @@ mapstruct ${project.version} - - ${project.groupId} - mapstruct-jdk8 - ${project.version} - ${project.groupId} mapstruct-processor @@ -320,10 +315,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.3 + 3.8.0 - 1.6 - 1.6 + 1.8 + 1.8 -proc:none @@ -440,7 +435,7 @@ org.apache.maven.plugins maven-shade-plugin - 2.3 + 3.2.0 com.mycila.maven-license-plugin @@ -460,12 +455,12 @@ org.codehaus.mojo animal-sniffer-maven-plugin - 1.9 + 1.16 org.ow2.asm asm-all - 5.0.2 + 5.2 diff --git a/pom.xml b/pom.xml index e24bfdd30..2786ef835 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,6 @@ parent build-config - core-common core core-jdk8 processor