Skip to content

Commit b369b8c

Browse files
committed
Pull #XXXX: pack checkstyle fatjar from maven cache, then upgrade version only need change pom.xml
1 parent bd72d32 commit b369b8c

File tree

6 files changed

+136
-26
lines changed

6 files changed

+136
-26
lines changed

net.sf.eclipsecs.checkstyle/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry exported="true" kind="lib" path="checkstyle-8.35-all.jar" sourcepath="checkstyle-checkstyle-8.35.zip"/>
3+
<classpathentry exported="true" kind="lib" path="checkstyle-all.jar" sourcepath="checkstyle-checkstyle-8.35.zip"/>
44
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
55
<attributes>
66
<attribute name="maven.pomderived" value="true"/>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/bin/
22
/*.zip
3+
checkstyle-*.jar

net.sf.eclipsecs.checkstyle/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ Export-Package: .,
4646
com.puppycrawl.tools.checkstyle.utils,
4747
org.apache.commons.beanutils;version="8.35.0"
4848
Bundle-ClassPath: .,
49-
checkstyle-8.35-all.jar
49+
checkstyle-all.jar
5050
Automatic-Module-Name: net.sf.eclipsecs.checkstyle
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
bin.includes = META-INF/,\
22
.,\
33
license/,\
4-
checkstyle-8.35-all.jar
4+
checkstyle-all.jar
55
jars.compile.order = .
66
source.. = metadata/
Binary file not shown.

net.sf.eclipsecs.checkstyle/pom.xml

Lines changed: 132 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,34 @@
99
<artifactId>net.sf.eclipsecs.checkstyle</artifactId>
1010
<packaging>eclipse-plugin</packaging>
1111
<name>Checkstyle Core Library Plugin</name>
12-
12+
1313
<properties>
1414
<checkstyle.version>8.35</checkstyle.version>
15+
<!-- -Dcheckstyle.downloadFile=checkstyle-8.36.zip -->
16+
<checkstyle.downloadFile>checkstyle-${checkstyle.version}.zip</checkstyle.downloadFile>
17+
<checkstyle.srcUrl>https://github.com/checkstyle/checkstyle/archive/${checkstyle.downloadFile}</checkstyle.srcUrl>
1518
</properties>
19+
<dependencies>
20+
<dependency>
21+
<groupId>com.puppycrawl.tools</groupId>
22+
<artifactId>checkstyle</artifactId>
23+
<version>${checkstyle.version}</version>
24+
</dependency>
25+
</dependencies>
1626
<build>
1727
<plugins>
18-
<plugin>
19-
<groupId>com.googlecode.maven-download-plugin</groupId>
20-
<artifactId>download-maven-plugin</artifactId>
21-
<executions>
22-
<execution>
23-
<id>download-checkstyle-src</id>
24-
<phase>initialize</phase>
25-
<goals>
26-
<goal>wget</goal>
27-
</goals>
28-
<configuration>
29-
<outputDirectory>.</outputDirectory>
30-
<url>https://github.com/checkstyle/checkstyle/archive/checkstyle-${checkstyle.version}.zip</url>
31-
<outputFileName>checkstyle-checkstyle-${checkstyle.version}.zip</outputFileName>
32-
</configuration>
33-
</execution>
34-
</executions>
35-
</plugin>
3628
<plugin>
3729
<artifactId>maven-antrun-plugin</artifactId>
3830
<executions>
3931
<execution>
4032
<phase>prepare-package</phase>
33+
<id>unpack-checkstyle-src</id>
4134
<configuration>
4235
<target>
4336
<delete dir="${project.build.directory}/checkstyle-src-unpack" />
4437
<delete dir="${project.build.directory}/checkstyle-src" />
45-
<first id="cssrc">
46-
<fileset dir="." includes="checkstyle-checkstyle-*.zip" />
47-
</first>
48-
<unzip src="${toString:cssrc}" dest="${project.build.directory}/checkstyle-src-unpack">
38+
<unzip src="${basedir}/checkstyle-${checkstyle.downloadFile}"
39+
dest="${project.build.directory}/checkstyle-src-unpack">
4940
<patternset>
5041
<include name="**/src/main/java/**" />
5142
<include name="**/src/main/resources/**" />
@@ -87,4 +78,122 @@
8778
</plugin>
8879
</plugins>
8980
</build>
81+
82+
<profiles>
83+
<profile>
84+
<id>download-checkstyle-src</id>
85+
<activation>
86+
<file>
87+
<missing>${basedir}/checkstyle-checkstyle-8.35.zip</missing><!-- change this when checkstyle.version changed -->
88+
</file>
89+
</activation>
90+
<build>
91+
<plugins>
92+
<plugin>
93+
<groupId>com.googlecode.maven-download-plugin</groupId>
94+
<artifactId>download-maven-plugin</artifactId>
95+
<executions>
96+
<execution>
97+
<id>download-checkstyle-src</id>
98+
<phase>initialize</phase>
99+
<goals>
100+
<goal>wget</goal>
101+
</goals>
102+
<configuration>
103+
<outputDirectory>.</outputDirectory>
104+
<url>${checkstyle.srcUrl}</url>
105+
<outputFileName>checkstyle-${checkstyle.downloadFile}</outputFileName>
106+
</configuration>
107+
</execution>
108+
</executions>
109+
</plugin>
110+
</plugins>
111+
</build>
112+
</profile>
113+
<profile>
114+
<id>pack-fat-checkstyle</id>
115+
<activation>
116+
<file>
117+
<missing>${basedir}/checkstyle-all-8.35.jar</missing><!-- change this when checkstyle.version changed -->
118+
</file>
119+
</activation>
120+
<build>
121+
<plugins>
122+
<plugin>
123+
<groupId>org.apache.maven.plugins</groupId>
124+
<artifactId>maven-dependency-plugin</artifactId>
125+
<version>3.1.2</version>
126+
<executions>
127+
<execution>
128+
<id>unpack</id>
129+
<phase>initialize</phase>
130+
<goals>
131+
<goal>unpack</goal>
132+
</goals>
133+
<configuration>
134+
<artifactItems>
135+
<artifactItem>
136+
<groupId>com.puppycrawl.tools</groupId>
137+
<artifactId>checkstyle</artifactId>
138+
<version>${checkstyle.version}</version>
139+
<outputDirectory>${project.build.directory}</outputDirectory>
140+
<includes>META-INF/MANIFEST.MF</includes>
141+
</artifactItem>
142+
</artifactItems>
143+
</configuration>
144+
</execution>
145+
</executions>
146+
</plugin>
147+
<plugin>
148+
<groupId>org.apache.maven.plugins</groupId>
149+
<artifactId>maven-assembly-plugin</artifactId>
150+
<version>3.3.0</version>
151+
<configuration>
152+
<descriptorRefs>
153+
<descriptorRef>jar-with-dependencies</descriptorRef>
154+
</descriptorRefs>
155+
<outputDirectory>${basedir}</outputDirectory>
156+
<finalName>checkstyle-all-${checkstyle.version}</finalName>
157+
<appendAssemblyId>false</appendAssemblyId>
158+
<formats>
159+
<format>jar</format>
160+
</formats>
161+
<overrideGroupName>com.puppycrawl.tools</overrideGroupName>
162+
<archive>
163+
<manifestFile>${project.build.directory}/META-INF/MANIFEST.MF</manifestFile>
164+
</archive>
165+
</configuration>
166+
<executions>
167+
<execution>
168+
<id>make-assembly</id>
169+
<phase>initialize</phase>
170+
<goals>
171+
<goal>single</goal>
172+
</goals>
173+
</execution>
174+
</executions>
175+
</plugin>
176+
<plugin>
177+
<artifactId>maven-antrun-plugin</artifactId>
178+
<executions>
179+
<execution>
180+
<phase>generate-sources</phase>
181+
<id>copy-heckstyle-all-jar</id>
182+
<configuration>
183+
<target>
184+
<delete file="${basedir}/checkstyle-all.jar" failonerror="false" />
185+
<copy file="${basedir}/checkstyle-all-${checkstyle.version}.jar"
186+
tofile="${basedir}/checkstyle-all.jar" overwrite="true" />
187+
</target>
188+
</configuration>
189+
<goals>
190+
<goal>run</goal>
191+
</goals>
192+
</execution>
193+
</executions>
194+
</plugin>
195+
</plugins>
196+
</build>
197+
</profile>
198+
</profiles>
90199
</project>

0 commit comments

Comments
 (0)