Skip to content

Commit

Permalink
Add CI stage to assemble a JAR file of sample with dependencies
Browse files Browse the repository at this point in the history
- Let's assemble a JAR file of the sample with the Maven "package"
  command, so that is easily run in CI. In order to build a JAR
  with the dependencies, we had to utilize the maven-assembly-plugin
  in the pom.xml and set the mainClass property in the configuration
  section of the plugin.
  • Loading branch information
datalogics-saharay committed Jan 18, 2024
1 parent adf2983 commit a2d5354
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-kotlin-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ jobs:
- name: Unpack APDFL from Maven Central
working-directory: ${{ matrix.dir }}
run: mvn -e process-resources
- name: Compile and assemble sample JAR file with dependencies
working-directory: ${{ matrix.dir }}
run: mvn -e package
22 changes: 22 additions & 0 deletions TextExtract/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,28 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.datalogics.pdfl.samples.TextExtractKt</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down

0 comments on commit a2d5354

Please sign in to comment.