Skip to content

Commit c2dff23

Browse files
authored
Update of build scripts (winder#1740)
* Removed the maven jgitver plugin and replaced them with mavens revision and changelist-feature. * Updated all poms to use version from parameter instead. * Removed unit tests that didn't test anything * Moved junit, hamcrest and easymock to parent so that all modules have access to them * Updated kotlin to a valid version (1.1.1 doesn't work in intellij anymore) * Attempt to get travis script to read version from tag
1 parent fcae0eb commit c2dff23

File tree

36 files changed

+146
-334
lines changed

36 files changed

+146
-334
lines changed

.mvn/extensions.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.mvn/maven.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Djava.util.logging.config.file=scripts/logging.config

.travis.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,22 @@ before_script:
2121
- curl -fL https://getcli.jfrog.io | sh
2222

2323
script:
24-
- mvn test install -B -Djava.util.logging.config.file=scripts/logging.config
24+
# Default to a snapshot build
25+
- export REVISION="2.0"
26+
- export CHANGELIST="-SNAPSHOT"
27+
# If a travis tag was defined extract the version number and unset the snapshot
28+
- if [[ $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then export REVISION=${TRAVIS_TAG:1}; export CHANGELIST=""; fi
29+
# Build using the revision
30+
- echo "Building version ${REVISION}${CHANGELIST}"
31+
- mvn test install -B -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
2532
- codecov
2633
# Make sure artifacts can be built
27-
- mvn package -pl ugs-classic assembly:assembly -DskipTests=true
28-
- mvn package -pl ugs-platform/application -P create-autoupdate -DskipTests=true
29-
- mvn package -pl ugs-platform/application -P create-macosx-package -DskipTests=true
30-
- mvn package -pl ugs-platform/application -P create-win-package -DskipTests=true
31-
- mvn package -pl ugs-platform/application -P create-linux-package -DskipTests=true
32-
- mvn package -pl ugs-platform/application -P create-pi-package -DskipTests=true
33-
34+
- mvn package -pl ugs-classic assembly:assembly -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
35+
- mvn package -pl ugs-platform/application -P create-autoupdate -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
36+
- mvn package -pl ugs-platform/application -P create-macosx-package -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
37+
- mvn package -pl ugs-platform/application -P create-win-package -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
38+
- mvn package -pl ugs-platform/application -P create-linux-package -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
39+
- mvn package -pl ugs-platform/application -P create-pi-package -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
3440

3541
deploy:
3642
# Only deploy as nightly if master branch without tag

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ mvn package assembly:assembly
122122

123123
#### Develop via IntelliJ
124124

125-
If you are more used to IntelliJ, you can also build, run and debug it there.
126-
127-
Before you start you need to change a setting for handling imports in Maven since we are using `jgitver`, [read more about it here](https://github.com/jgitver/jgitver-maven-plugin/wiki/Intellij-IDEA-configuration).
125+
If you are more used to IntelliJ, you can also build, run and debug it there.
128126

129127
- Run `mvn nbm:run-platform -pl ugs-platform/application` once via terminal to build everything
130128
- Import the Source, `File` -> `New` -> `Project from existing Sources`

new-module-archetype/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
<groupId>com.willwinder</groupId>
66
<artifactId>ugs-plugin-archetype</artifactId>
7-
<version>2.0-SNAPSHOT</version>
87
<packaging>maven-archetype</packaging>
98

109
<name>ugs-plugin-archetype</name>

new-module-archetype/src/main/resources/archetype-resources/pom.xml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.willwinder</groupId>
66
<artifactId>ugs-platform-parent</artifactId>
7-
<version>2.0-SNAPSHOT</version>
7+
<version>${revision}</version>
88
</parent>
99

1010
<artifactId>${artifactId}</artifactId>
@@ -78,25 +78,6 @@
7878
<groupId>org.netbeans.api</groupId>
7979
<artifactId>org-netbeans-modules-settings</artifactId>
8080
<version>${netbeans.version}</version>
81-
</dependency>
82-
<dependency>
83-
<groupId>junit</groupId>
84-
<artifactId>junit</artifactId>
85-
<version>4.12</version>
86-
<scope>test</scope>
87-
</dependency>
88-
<dependency>
89-
<groupId>org.mockito</groupId>
90-
<artifactId>mockito-core</artifactId>
91-
<version>${mockito.version}</version>
92-
<scope>test</scope>
93-
<type>jar</type>
94-
</dependency>
95-
<dependency>
96-
<groupId>org.hamcrest</groupId>
97-
<artifactId>hamcrest-core</artifactId>
98-
<version>1.3</version>
99-
<scope>test</scope>
100-
</dependency>
81+
</dependency>
10182
</dependencies>
10283
</project>

pom.xml

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.willwinder.universalgcodesender</groupId>
77
<artifactId>ugs-parent</artifactId>
8-
<version>2.0-SNAPSHOT</version>
8+
<version>${revision}${changelist}</version>
99
<packaging>pom</packaging>
1010

1111
<inceptionYear>2012</inceptionYear>
@@ -35,6 +35,10 @@
3535
</developers>
3636

3737
<properties>
38+
<revision>2.0</revision>
39+
<changelist>-SNAPSHOT</changelist>
40+
41+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3842
<jetty.version>9.4.17.v20190418</jetty.version>
3943
<jersey.version>2.29.1</jersey.version>
4044
<gluegen.version>2.3.2</gluegen.version>
@@ -57,6 +61,16 @@
5761
<download-maven-plugin.version>1.3.0</download-maven-plugin.version>
5862
<mockito.version>3.2.4</mockito.version>
5963
<batik.version>1.14</batik.version>
64+
<ugs.maven-resources-plugin.version>3.1.0</ugs.maven-resources-plugin.version>
65+
<ugs.maven-jar-plugin.version>3.2.0</ugs.maven-jar-plugin.version>
66+
<ugs.flatten-maven-plugin.version>1.2.2</ugs.flatten-maven-plugin.version>
67+
<ugs.junit.version>4.13.2</ugs.junit.version>
68+
<ugs.hamcrest-core.version>2.2</ugs.hamcrest-core.version>
69+
<ugs.maven-shade-plugin.version>2.4.1</ugs.maven-shade-plugin.version>
70+
<ugs.progressbar.version>0.7.2</ugs.progressbar.version>
71+
<ugs.commons-cli.version>1.4</ugs.commons-cli.version>
72+
<ugs.easymock.version>3.4</ugs.easymock.version>
73+
<ugs.maven-assembly-plugin.version>2.5.3</ugs.maven-assembly-plugin.version>
6074

6175
<!-- Sets the timestamp format -->
6276
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
@@ -166,6 +180,33 @@
166180
<groupId>org.apache.maven.plugins</groupId>
167181
<version>${ugs.surefire.version}</version>
168182
</plugin>
183+
184+
<!-- For generating POM files with the revision number -->
185+
<plugin>
186+
<groupId>org.codehaus.mojo</groupId>
187+
<artifactId>flatten-maven-plugin</artifactId>
188+
<version>${ugs.flatten-maven-plugin.version}</version>
189+
<configuration>
190+
<updatePomFile>true</updatePomFile>
191+
<flattenMode>resolveCiFriendliesOnly</flattenMode>
192+
</configuration>
193+
<executions>
194+
<execution>
195+
<id>flatten</id>
196+
<phase>process-resources</phase>
197+
<goals>
198+
<goal>flatten</goal>
199+
</goals>
200+
</execution>
201+
<execution>
202+
<id>flatten.clean</id>
203+
<phase>clean</phase>
204+
<goals>
205+
<goal>clean</goal>
206+
</goals>
207+
</execution>
208+
</executions>
209+
</plugin>
169210
</plugins>
170211
</build>
171212

@@ -183,7 +224,7 @@
183224
<dependency>
184225
<groupId>junit</groupId>
185226
<artifactId>junit</artifactId>
186-
<version>4.12</version>
227+
<version>${ugs.junit.version}</version>
187228
<scope>test</scope>
188229
</dependency>
189230
<dependency>
@@ -196,13 +237,19 @@
196237
<dependency>
197238
<groupId>org.hamcrest</groupId>
198239
<artifactId>hamcrest-core</artifactId>
199-
<version>1.3</version>
240+
<version>${ugs.hamcrest-core.version}</version>
200241
<scope>test</scope>
201242
</dependency>
202243
<dependency>
203244
<groupId>org.assertj</groupId>
204245
<artifactId>assertj-core</artifactId>
205-
<version>3.8.0</version>
246+
<version>3.21.0</version>
247+
<scope>test</scope>
248+
</dependency>
249+
<dependency>
250+
<groupId>org.easymock</groupId>
251+
<artifactId>easymock</artifactId>
252+
<version>${ugs.easymock.version}</version>
206253
<scope>test</scope>
207254
</dependency>
208255
</dependencies>
@@ -235,7 +282,7 @@
235282
<plugin>
236283
<groupId>org.sonatype.plugins</groupId>
237284
<artifactId>nexus-staging-maven-plugin</artifactId>
238-
<version>1.6.7</version>
285+
<version>1.6.8</version>
239286
<extensions>true</extensions>
240287
<configuration>
241288
<serverId>ossrh</serverId>
@@ -248,7 +295,7 @@
248295
<plugin>
249296
<groupId>org.apache.maven.plugins</groupId>
250297
<artifactId>maven-source-plugin</artifactId>
251-
<version>2.2.1</version>
298+
<version>3.2.1</version>
252299
<executions>
253300
<execution>
254301
<id>attach-sources</id>
@@ -263,7 +310,7 @@
263310
<plugin>
264311
<groupId>org.apache.maven.plugins</groupId>
265312
<artifactId>maven-javadoc-plugin</artifactId>
266-
<version>2.9.1</version>
313+
<version>3.3.1</version>
267314
<executions>
268315
<execution>
269316
<id>attach-javadocs</id>
@@ -278,7 +325,7 @@
278325
<plugin>
279326
<groupId>org.apache.maven.plugins</groupId>
280327
<artifactId>maven-gpg-plugin</artifactId>
281-
<version>1.5</version>
328+
<version>3.0.1</version>
282329
<executions>
283330
<execution>
284331
<id>sign-artifacts</id>

scripts/logging.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
handlers = java.util.logging.ConsoleHandler
2-
.level=ERROR
2+
.level=SEVERE

ugs-classic/pom.xml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
<parent>
66
<groupId>com.willwinder.universalgcodesender</groupId>
77
<artifactId>ugs-parent</artifactId>
8-
<version>2.0-SNAPSHOT</version>
8+
<version>${revision}${changelist}</version>
99
</parent>
1010

1111
<artifactId>ugs-classic</artifactId>
12-
<version>2.0-SNAPSHOT</version>
1312
<packaging>jar</packaging>
1413

1514
<name>${project.artifactId}</name>
@@ -39,16 +38,6 @@
3938
<artifactId>ugs-cli</artifactId>
4039
<version>${project.version}</version>
4140
</dependency>
42-
43-
<!-- ************************* -->
44-
<!-- *** TEST dependencies ***-->
45-
46-
<dependency>
47-
<groupId>org.easymock</groupId>
48-
<artifactId>easymock</artifactId>
49-
<version>3.4</version>
50-
<scope>test</scope>
51-
</dependency>
5241
</dependencies>
5342

5443
<build>
@@ -63,7 +52,7 @@
6352
<plugin>
6453
<groupId>org.apache.maven.plugins</groupId>
6554
<artifactId>maven-jar-plugin</artifactId>
66-
<version>2.5</version>
55+
<version>${ugs.maven-jar-plugin.version}</version>
6756
<configuration>
6857
<archive>
6958
<manifest>
@@ -78,7 +67,7 @@
7867
<plugin>
7968
<groupId>org.apache.maven.plugins</groupId>
8069
<artifactId>maven-shade-plugin</artifactId>
81-
<version>2.4.1</version>
70+
<version>${ugs.maven-shade-plugin.version}</version>
8271
<executions>
8372
<execution>
8473
<phase>package</phase>
@@ -95,6 +84,7 @@
9584
<filter>
9685
<artifact>*:*</artifact>
9786
<excludes>
87+
<exclude>module-info.*</exclude>
9888
<exclude>META-INF/*.SF</exclude>
9989
<exclude>META-INF/*.DSA</exclude>
10090
<exclude>META-INF/*.RSA</exclude>
@@ -110,7 +100,7 @@
110100
<plugin>
111101
<groupId>org.apache.maven.plugins</groupId>
112102
<artifactId>maven-assembly-plugin</artifactId>
113-
<version>2.5.3</version>
103+
<version>${ugs.maven-assembly-plugin.version}</version>
114104
<configuration>
115105
<finalName>UniversalGcodeSender</finalName>
116106
<appendAssemblyId>false</appendAssemblyId>

ugs-cli/pom.xml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,21 @@
55
<parent>
66
<groupId>com.willwinder.universalgcodesender</groupId>
77
<artifactId>ugs-parent</artifactId>
8-
<version>2.0-SNAPSHOT</version>
8+
<version>${revision}${changelist}</version>
99
</parent>
1010

1111
<artifactId>ugs-cli</artifactId>
12-
<version>2.0-SNAPSHOT</version>
1312
<packaging>jar</packaging>
1413

1514
<name>${project.artifactId}</name>
1615
<description>Universal Gcode Sender terminal client</description>
1716
<url>https://github.com/winder/Universal-G-Code-Sender/tree/master/ugs-terminal-client</url>
1817

19-
<properties>
20-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21-
<project.build.releaseSourceDirectory>release_files</project.build.releaseSourceDirectory>
22-
<maven.compiler.source>1.8</maven.compiler.source>
23-
<maven.compiler.target>1.8</maven.compiler.target>
24-
</properties>
25-
2618
<dependencies>
2719
<dependency>
2820
<groupId>commons-cli</groupId>
2921
<artifactId>commons-cli</artifactId>
30-
<version>1.4</version>
22+
<version>${ugs.commons-cli.version}</version>
3123
</dependency>
3224
<dependency>
3325
<groupId>com.willwinder.universalgcodesender</groupId>
@@ -42,7 +34,7 @@
4234
<dependency>
4335
<groupId>me.tongfei</groupId>
4436
<artifactId>progressbar</artifactId>
45-
<version>0.7.2</version>
37+
<version>${ugs.progressbar.version}</version>
4638
</dependency>
4739
</dependencies>
4840

@@ -67,7 +59,7 @@
6759
<plugin>
6860
<groupId>org.apache.maven.plugins</groupId>
6961
<artifactId>maven-jar-plugin</artifactId>
70-
<version>2.5</version>
62+
<version>${ugs.maven-jar-plugin.version}</version>
7163
<configuration>
7264
<archive>
7365
<manifest>

ugs-core/pom.xml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
<parent>
66
<groupId>com.willwinder.universalgcodesender</groupId>
77
<artifactId>ugs-parent</artifactId>
8-
<version>2.0-SNAPSHOT</version>
8+
<version>${revision}${changelist}</version>
99
</parent>
1010

1111
<artifactId>ugs-core</artifactId>
12-
<version>2.0-SNAPSHOT</version>
1312
<packaging>jar</packaging>
1413

1514
<name>${project.artifactId}</name>
@@ -24,11 +23,6 @@
2423
</properties>
2524

2625
<dependencies>
27-
<dependency>
28-
<groupId>javax.websocket</groupId>
29-
<artifactId>javax.websocket-client-api</artifactId>
30-
<version>1.0</version>
31-
</dependency>
3226
<dependency>
3327
<groupId>org.glassfish.tyrus.bundles</groupId>
3428
<artifactId>tyrus-standalone-client</artifactId>
@@ -111,17 +105,6 @@
111105
<artifactId>core</artifactId>
112106
<version>${zxing.version}</version>
113107
</dependency>
114-
115-
116-
<!-- ************************* -->
117-
<!-- *** TEST dependencies ***-->
118-
119-
<dependency>
120-
<groupId>org.easymock</groupId>
121-
<artifactId>easymock</artifactId>
122-
<version>3.4</version>
123-
<scope>test</scope>
124-
</dependency>
125108
</dependencies>
126109

127110
<build>

0 commit comments

Comments
 (0)