Skip to content

Commit

Permalink
Add jar bundle profile
Browse files Browse the repository at this point in the history
And add goal "verify" to Maven command in GitHub CI Workflow
  • Loading branch information
maximevw committed Jan 7, 2020
1 parent 2ee35a9 commit 5d2d19a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: 11.0.5

- name: Build with Maven
run: mvn -B package
run: mvn -B package verify
12 changes: 8 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ mvn test

#### Maven profiles

Autolog project provides some useful profiles to help developers to guarantee the quality of the code, of the tests and
reduce potential vulnerabilities:
Autolog project provides some useful profiles to help developers to guarantee the quality of the code, of the tests,
reduce potential vulnerabilities, ...
* **Dependency check**: to detect vulnerabilities in third party dependencies, you can run the build with the profile
`dependency-check` executing the plugin `dependency-check-maven` from OWASP and generating a report in `target/owasp`
directory.
Expand All @@ -66,9 +66,13 @@ whole project. However, the coverage reports can be generated separately for eac
```
mvn clean install -Pwith-coverage-by-module
```
* **Bundle**: to bundle jar for each module including dependencies.
```
mvn clean package -Pbundle
```

*Note*: a profile `release` also exists and is designed to prepare and build release versions of Autolog (compilation,
signing artifacts, ...). It is reserved for the project owners.
*Note*: a profile `release` also exists and is designed to prepare, build and deploy release versions of Autolog
(compilation, signing artifacts, ...). It is reserved for the project owners.

### Submit a pull request

Expand Down
29 changes: 29 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
<maven-shade-plugin.version>3.2.1</maven-shade-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<mockito.version>3.2.0</mockito.version>
Expand Down Expand Up @@ -563,6 +564,34 @@
</build>
</profile>

<!-- 'bundle' profile creates jar including dependencies for each module and should be used for bundling of
stable versions only. -->
<profile>
<id>bundle</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<createSourcesJar>false</createSourcesJar>
<shadedArtifactAttached>true</shadedArtifactAttached>
<finalName>${project.artifactId}-${project.version}-bundle</finalName>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<!-- 'dependency-check' profile runs OWASP scan on specified modules when activated. -->
<profile>
<id>dependency-check</id>
Expand Down

0 comments on commit 5d2d19a

Please sign in to comment.