Skip to content

Commit 7e6877e

Browse files
committed
Prepare for release and align build with the way MapStruct is build
1 parent 252ff32 commit 7e6877e

9 files changed

Lines changed: 878 additions & 70 deletions

File tree

LICENSE.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright MapStruct Authors.
2+
3+
MapStruct Tools Gem is licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
4+
5+
------------------------------------------------------------------------
6+
7+
MAPSTRUCT Tools Gem SUBCOMPONENTS WITH DIFFERENT COPYRIGHT OWNERS
8+
9+
The Tools Gem distribution (ZIP, TAR.GZ) as well as the Tools Gem
10+
processor library (JAR) include FreeMarker, a software developed by
11+
Attila Szegedi, Daniel Dekany and Jonathan Revusky. FreeMarker is
12+
licensed under the same license as Tools Gem itself - Apache License,
13+
Version 2.0 - but the copyright owners are the aforementioned individuals.
14+
15+
The Tools Gem distribution (ZIP, TAR.GZ) as well as the Tools Gem
16+
processor library (JAR) include a number of files that are licensed by the
17+
Apache Software Foundation under the same license as Tools Gem itself -
18+
Apache License, Version 2.0 - but the copyright owner is the Apache
19+
Software Foundation. These files are:
20+
21+
freemarker/ext/jsp/web-app_2_2.dtd
22+
freemarker/ext/jsp/web-app_2_3.dtd
23+
freemarker/ext/jsp/web-app_2_4.xsd
24+
freemarker/ext/jsp/web-app_2_5.xsd
25+
freemarker/ext/jsp/web-jsptaglibrary_1_1.dtd
26+
freemarker/ext/jsp/web-jsptaglibrary_1_2.dtd
27+
freemarker/ext/jsp/web-jsptaglibrary_2_0.xsd
28+
freemarker/ext/jsp/web-jsptaglibrary_2_1.xsd

api/pom.xml

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,87 @@
88
-->
99
<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">
1010
<modelVersion>4.0.0</modelVersion>
11+
12+
<parent>
13+
<groupId>org.mapstruct.tools.gem</groupId>
14+
<artifactId>gem-parent</artifactId>
15+
<version>0.5.0-SNAPSHOT</version>
16+
<relativePath>../parent/pom.xml</relativePath>
17+
</parent>
18+
19+
<artifactId>gem-api</artifactId>
20+
<packaging>jar</packaging>
21+
<name>MapStruct Tools Gem API</name>
22+
1123
<build>
1224
<plugins>
1325
<plugin>
1426
<groupId>org.apache.maven.plugins</groupId>
15-
<artifactId>maven-compiler-plugin</artifactId>
27+
<artifactId>maven-checkstyle-plugin</artifactId>
28+
<executions>
29+
<execution>
30+
<id>check-style</id>
31+
<phase>verify</phase>
32+
<goals>
33+
<goal>checkstyle</goal>
34+
</goals>
35+
</execution>
36+
</executions>
37+
</plugin>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-source-plugin</artifactId>
41+
<executions>
42+
<execution>
43+
<id>attach-sources</id>
44+
<phase>verify</phase>
45+
<goals>
46+
<goal>jar</goal>
47+
</goals>
48+
</execution>
49+
</executions>
50+
</plugin>
51+
<plugin>
52+
<groupId>org.apache.maven.plugins</groupId>
53+
<artifactId>maven-resources-plugin</artifactId>
54+
<executions>
55+
<execution>
56+
<id>copy-mapstruct-license</id>
57+
<phase>prepare-package</phase>
58+
<goals>
59+
<goal>copy-resources</goal>
60+
</goals>
61+
<configuration>
62+
<outputDirectory>${project.build.directory}/classes/META-INF</outputDirectory>
63+
<resources>
64+
<resource>
65+
<directory>${basedir}/..</directory>
66+
<filtering>false</filtering>
67+
<include>LICENSE.txt</include>
68+
</resource>
69+
</resources>
70+
</configuration>
71+
</execution>
72+
</executions>
73+
</plugin>
74+
<plugin>
75+
<groupId>org.apache.felix</groupId>
76+
<artifactId>maven-bundle-plugin</artifactId>
1677
<configuration>
17-
<source>8</source>
18-
<target>8</target>
78+
<instructions>
79+
<Automatic-Module-Name>org.mapstruct.tools.gem</Automatic-Module-Name>
80+
</instructions>
81+
</configuration>
82+
</plugin>
83+
<plugin>
84+
<artifactId>maven-jar-plugin</artifactId>
85+
<configuration>
86+
<archive>
87+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
88+
</archive>
1989
</configuration>
2090
</plugin>
2191
</plugins>
2292
</build>
2393

24-
<parent>
25-
<groupId>org.mapstruct.tools.gem</groupId>
26-
<version>0.5.0-SNAPSHOT</version>
27-
<artifactId>gem-aggregator</artifactId>
28-
<relativePath>../pom.xml</relativePath>
29-
</parent>
30-
31-
<artifactId>gem-api</artifactId>
32-
<packaging>jar</packaging>
33-
<name>Annotation Helper API</name>
34-
3594
</project>

etc/checkstyle.xml

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
<?xml version="1.0"?>
2+
3+
<!DOCTYPE module PUBLIC
4+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
5+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
6+
7+
<!-- Based on sun_checks.xml from the CheckStyle distribution -->
8+
9+
<module name="Checker">
10+
<!--
11+
If you set the basedir property below, then all reported file
12+
names will be relative to the specified directory. See
13+
http://checkstyle.sourceforge.net/5.x/config.html#Checker
14+
15+
<property name="basedir" value="${basedir}"/>
16+
-->
17+
18+
<!-- Checks that each Java package has a Javadoc file used for commenting. -->
19+
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
20+
<!--
21+
<module name="JavadocPackage">
22+
<property name="allowLegacy" value="true"/>
23+
</module>
24+
-->
25+
26+
<!-- Checks that property files contain the same keys. -->
27+
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
28+
<module name="Translation"/>
29+
30+
<module name="FileLength"/>
31+
32+
<!-- Following interprets the header file as regular expressions. -->
33+
<!-- <module name="RegexpHeader"/> -->
34+
35+
<module name="FileTabCharacter">
36+
<property name="eachLine" value="true"/>
37+
</module>
38+
39+
<!-- Not using NewLineAtEndOfFile as it doesn't work across all platforms
40+
in conjunction with git's automatic handling of line endings. This rule fails
41+
if there is a non-whitespace character at the end of the file; Together with
42+
the next rule which forbids trailing whitespace characters this enforces a
43+
new line at the end of the file -->
44+
<module name="RegexpMultiline">
45+
<property name="format" value="\S\z" />
46+
<property name="message" value="There is no new line at the end of file" />
47+
</module>
48+
49+
<module name="RegexpSingleline">
50+
<!-- \s matches whitespace character, $ matches end of line. -->
51+
<property name="format" value="\s+$"/>
52+
<property name="message" value="Line has trailing spaces"/>
53+
</module>
54+
55+
<module name="RegexpSingleline">
56+
<!-- do not allow a package declaration that contains ".target." or "target;" -->
57+
<property name="format" value="^package .*\.target[\.;]"/>
58+
<property name="message" value="Do not use &quot;target&quot; as package name element"/>
59+
</module>
60+
61+
<module name="TreeWalker">
62+
63+
<property name="cacheFile" value="${checkstyle.cache.file}"/>
64+
65+
<module name="SuppressWarningsHolder"/>
66+
67+
<!-- Checks for Javadoc comments. -->
68+
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
69+
<!-- <module name="JavadocMethod"/> -->
70+
<!-- <module name="JavadocType"/> -->
71+
<!-- <module name="JavadocVariable"/> -->
72+
<!-- <module name="JavadocStyle"/> -->
73+
74+
75+
<!-- Checks for Naming Conventions. -->
76+
<!-- See http://checkstyle.sf.net/config_naming.html -->
77+
<module name="ConstantName"/>
78+
<module name="LocalFinalVariableName"/>
79+
<module name="LocalVariableName"/>
80+
<module name="MemberName"/>
81+
<module name="MethodName"/>
82+
<module name="PackageName"/>
83+
<module name="ParameterName"/>
84+
<module name="StaticVariableName"/>
85+
<module name="TypeName"/>
86+
87+
88+
<!-- Checks for Headers -->
89+
<!-- See http://checkstyle.sf.net/config_header.html -->
90+
<!-- <module name="Header"> -->
91+
<!-- The follow property value demonstrates the ability -->
92+
<!-- to have access to ANT properties. In this case it uses -->
93+
<!-- the ${basedir} property to allow Checkstyle to be run -->
94+
<!-- from any directory within a project. See property -->
95+
<!-- expansion, -->
96+
<!-- http://checkstyle.sf.net/config.html#properties -->
97+
<!-- <property -->
98+
<!-- name="headerFile" -->
99+
<!-- value="${basedir}/java.header"/> -->
100+
<!-- </module> -->
101+
102+
103+
<!-- Checks for imports -->
104+
<!-- See http://checkstyle.sf.net/config_import.html -->
105+
<module name="AvoidStarImport"/>
106+
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
107+
<module name="RedundantImport"/>
108+
<module name="UnusedImports">
109+
<property name="processJavadoc" value="true"/>
110+
</module>
111+
<module name="ImportControl">
112+
<property name="file" value="${checkstyleDir}/import-control.xml" />
113+
</module>
114+
115+
116+
<!-- Checks for Size Violations. -->
117+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
118+
<module name="LineLength">
119+
<property name="max" value="120"/>
120+
</module>
121+
<module name="MethodLength"/>
122+
<module name="ParameterNumber">
123+
<property name="max" value="10"/>
124+
</module>
125+
126+
127+
<!-- Checks for whitespace -->
128+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
129+
<module name="EmptyForIteratorPad">
130+
<property name="option" value="space" />
131+
</module>
132+
<module name="MethodParamPad"/>
133+
<module name="NoWhitespaceAfter">
134+
<property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
135+
</module>
136+
<module name="NoWhitespaceBefore"/>
137+
<!-- <module name="OperatorWrap"/> -->
138+
<module name="ParenPad">
139+
<property name="tokens" value="CTOR_CALL, METHOD_CALL, SUPER_CTOR_CALL"/>
140+
<property name="option" value="space"/>
141+
</module>
142+
<module name="TypecastParenPad"/>
143+
<module name="WhitespaceAfter"/>
144+
<module name="WhitespaceAround"/>
145+
146+
<module name="EmptyLineSeparator">
147+
<property name="tokens" value="IMPORT, CLASS_DEF, INTERFACE_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
148+
<property name="allowNoEmptyLineBetweenFields" value="true"/>
149+
<property name="allowMultipleEmptyLines" value="false"/>
150+
</module>
151+
152+
<!-- Modifier Checks -->
153+
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
154+
<module name="ModifierOrder"/>
155+
<module name="RedundantModifier"/>
156+
157+
158+
<!-- Checks for blocks. You know, those {}'s -->
159+
<!-- See http://checkstyle.sf.net/config_blocks.html -->
160+
<module name="AvoidNestedBlocks"/>
161+
<module name="EmptyBlock"/>
162+
<module name="LeftCurly"/>
163+
<module name="NeedBraces"/>
164+
<module name="RightCurly">
165+
<property name="option" value="alone"/>
166+
</module>
167+
168+
169+
<!-- Checks for common coding problems -->
170+
<!-- See http://checkstyle.sf.net/config_coding.html -->
171+
<!-- <module name="AvoidInlineConditionals"/> -->
172+
<module name="EmptyStatement"/>
173+
<module name="EqualsHashCode"/>
174+
<!-- <module name="HiddenField"/> -->
175+
<module name="IllegalInstantiation"/>
176+
<module name="InnerAssignment"/>
177+
<!-- <module name="MagicNumber"/> -->
178+
<module name="MissingSwitchDefault"/>
179+
<!-- <module name="RedundantThrows"/> -->
180+
<module name="SimplifyBooleanExpression"/>
181+
<module name="SimplifyBooleanReturn"/>
182+
183+
184+
<!-- Checks for class design -->
185+
<!-- See http://checkstyle.sf.net/config_design.html -->
186+
<!-- <module name="DesignForExtension"/> -->
187+
<!-- <module name="FinalClass"/> -->
188+
<module name="HideUtilityClassConstructor"/>
189+
<module name="InterfaceIsType"/>
190+
<module name="VisibilityModifier">
191+
<property name="packageAllowed" value="true" />
192+
<property name="protectedAllowed" value="true" />
193+
</module>
194+
195+
196+
<!-- Miscellaneous other checks. -->
197+
<!-- See http://checkstyle.sf.net/config_misc.html -->
198+
<module name="ArrayTypeStyle"/>
199+
<!-- <module name="FinalParameters"/> -->
200+
<!-- <module name="TodoComment"/> -->
201+
<module name="UpperEll"/>
202+
203+
<module name="SuppressionCommentFilter"/>
204+
</module>
205+
206+
<module name="SuppressWarningsFilter"/>
207+
208+
</module>

etc/import-control.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE import-control PUBLIC
3+
"-//Puppy Crawl//DTD Import Control 1.1//EN"
4+
"http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
5+
<import-control pkg="org.mapstruct">
6+
7+
<allow pkg=".*" regex="true" />
8+
9+
<subpackage name="ap">
10+
<!-- the annotation processor may not use the annotations or enums specified in org.mapstruct directly... -->
11+
<disallow pkg="org.mapstruct" exact-match="true" />
12+
13+
<subpackage name="internal.gem">
14+
<!-- ... with exception to the package org.mapstruct.ap.internal.gem -->
15+
<allow pkg=".*" regex="true" />
16+
</subpackage>
17+
<subpackage name="test">
18+
<allow pkg=".*" regex="true" />
19+
</subpackage>
20+
<subpackage name="testutil">
21+
<allow pkg=".*" regex="true" />
22+
</subpackage>
23+
</subpackage>
24+
</import-control>

etc/license.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Copyright MapStruct Authors.
2+
3+
Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0

0 commit comments

Comments
 (0)