Skip to content

Commit 996d3a5

Browse files
authored
Merge pull request #801 from johnjaylward/updateActionsForDeploy
Updates the pipeline to validate that packaging a jar works properly
2 parents d677a99 + 3894483 commit 996d3a5

4 files changed

Lines changed: 40 additions & 12 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This workflow will build a Java project with Maven
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
2+
# For more information see: https://docs.github.com/en/actions/learn-github-actions or https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
33

44
name: Java CI with Maven
55

@@ -37,13 +37,21 @@ jobs:
3737
mvn site -DgenerateReports=false -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }}
3838
- name: Upload Test Results ${{ matrix.java }}
3939
if: ${{ always() }}
40-
uses: actions/upload-artifact@v1
40+
uses: actions/upload-artifact@v3
4141
with:
4242
name: Test Results ${{ matrix.java }}
4343
path: target/surefire-reports/
4444
- name: Upload Test Report ${{ matrix.java }}
4545
if: ${{ always() }}
46-
uses: actions/upload-artifact@v1
46+
uses: actions/upload-artifact@v3
4747
with:
4848
name: Test Report ${{ matrix.java }}
4949
path: target/site/
50+
- name: Package Jar ${{ matrix.java }}
51+
run: mvn clean package -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true
52+
- name: Upload Package Results ${{ matrix.java }}
53+
if: ${{ always() }}
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: Package Jar ${{ matrix.java }}
57+
path: target/*.jar

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ignore eclipse project files
22
.project
33
.classpath
4+
# ignore vscode files
5+
.vscode
46
# ignore Intellij Idea project files
57
.idea
68
*.iml

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ JSON in Java [package org.json]
77
===============================
88

99
[![Maven Central](https://img.shields.io/maven-central/v/org.json/json.svg)](https://mvnrepository.com/artifact/org.json/json)
10+
[![Java CI with Maven](https://github.com/stleary/JSON-java/actions/workflows/pipeline.yml/badge.svg)](https://github.com/stleary/JSON-java/actions/workflows/pipeline.yml)
11+
[![CodeQL](https://github.com/stleary/JSON-java/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/stleary/JSON-java/actions/workflows/codeql-analysis.yml)
1012

1113
**[Click here if you just want the latest release jar file.](https://search.maven.org/remotecontent?filepath=org/json/json/20231013/json-20231013.jar)**
1214

@@ -24,7 +26,7 @@ Project goals include:
2426
* No external dependencies
2527
* Fast execution and low memory footprint
2628
* Maintain backward compatibility
27-
* Designed and tested to use on Java versions 1.6 - 1.11
29+
* Designed and tested to use on Java versions 1.8 - 17
2830

2931
The files in this package implement JSON encoders and decoders. The package can also convert between JSON and XML, HTTP headers, Cookies, and CDL.
3032

pom.xml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5353
</properties>
5454

55-
5655
<dependencies>
5756
<dependency>
5857
<groupId>junit</groupId>
@@ -159,17 +158,34 @@
159158
<autoReleaseAfterClose>false</autoReleaseAfterClose>
160159
</configuration>
161160
</plugin>
161+
<plugin>
162+
<groupId>org.moditect</groupId>
163+
<artifactId>moditect-maven-plugin</artifactId>
164+
<version>1.0.0.Final</version>
165+
<executions>
166+
<execution>
167+
<id>add-module-infos</id>
168+
<phase>package</phase>
169+
<goals>
170+
<goal>add-module-info</goal>
171+
</goals>
172+
<configuration>
173+
<jvmVersion>9</jvmVersion>
174+
<module>
175+
<moduleInfoSource>
176+
module org.json {
177+
exports org.json;
178+
}
179+
</moduleInfoSource>
180+
</module>
181+
</configuration>
182+
</execution>
183+
</executions>
184+
</plugin>
162185
<plugin>
163186
<groupId>org.apache.maven.plugins</groupId>
164187
<artifactId>maven-jar-plugin</artifactId>
165188
<version>3.3.0</version>
166-
<configuration>
167-
<archive>
168-
<manifestEntries>
169-
<Automatic-Module-Name>org.json</Automatic-Module-Name>
170-
</manifestEntries>
171-
</archive>
172-
</configuration>
173189
</plugin>
174190
</plugins>
175191
</build>

0 commit comments

Comments
 (0)