Various Maven build tweaks

* Introduces a `quick` profile that skips Checkstyle validation and test compilation.
* Removes `clean` goal from "DataNucleus Enhance" run configuration.
* Adds Maven config to suppress verbose dependency download output.

Signed-off-by: nscuro <nscuro@protonmail.com>
This commit is contained in:
nscuro 2025-06-12 19:50:14 +02:00
parent 9427d40657
commit ec68087c4f
No known key found for this signature in database
9 changed files with 47 additions and 14 deletions

View file

@ -47,12 +47,11 @@ jobs:
- name: Build with Maven - name: Build with Maven
run: |- run: |-
mvn -B --no-transfer-progress clean mvn -B package -P quick -P enhance -P embedded-jetty -Dservices.bom.merge.skip=false -Dlogback.configuration.file=src/main/docker/logback.xml
mvn -B --no-transfer-progress package -Dmaven.test.skip=true -P enhance -P embedded-jetty -Dservices.bom.merge.skip=false -Dlogback.configuration.file=src/main/docker/logback.xml mvn -B clean -P clean-exclude-wars
mvn -B --no-transfer-progress clean -P clean-exclude-wars mvn -B package -P quick -P enhance -P embedded-jetty -P bundle-ui -Dservices.bom.merge.skip=false -Dlogback.configuration.file=src/main/docker/logback.xml
mvn -B --no-transfer-progress package -Dmaven.test.skip=true -P enhance -P embedded-jetty -P bundle-ui -Dservices.bom.merge.skip=false -Dlogback.configuration.file=src/main/docker/logback.xml mvn -B clean -P clean-exclude-wars
mvn -B --no-transfer-progress clean -P clean-exclude-wars mvn -B cyclonedx:makeBom -Dservices.bom.merge.skip=false org.codehaus.mojo:exec-maven-plugin:exec@merge-services-bom
mvn -B --no-transfer-progress cyclonedx:makeBom -Dservices.bom.merge.skip=false org.codehaus.mojo:exec-maven-plugin:exec@merge-services-bom
- name: Upload Artifacts - name: Upload Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2

View file

@ -5,6 +5,7 @@
<option name="myRunnerSettings" /> <option name="myRunnerSettings" />
<option name="myRunnerParameters"> <option name="myRunnerParameters">
<MavenRunnerParameters> <MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles"> <option name="profiles">
<set /> <set />
</option> </option>
@ -16,14 +17,19 @@
<option value="-Dlogback.configuration.file=src/main/docker/logback.xml" /> <option value="-Dlogback.configuration.file=src/main/docker/logback.xml" />
</list> </list>
</option> </option>
<option name="multimoduleDir" />
<option name="pomFileName" /> <option name="pomFileName" />
<option name="profilesMap"> <option name="profilesMap">
<map> <map>
<entry key="quick" value="true" />
<entry key="embedded-jetty" value="true" /> <entry key="embedded-jetty" value="true" />
<entry key="clean-exclude-wars" value="true" /> <entry key="clean-exclude-wars" value="true" />
<entry key="enhance" value="true" /> <entry key="enhance" value="true" />
</map> </map>
</option> </option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" /> <option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" /> <option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters> </MavenRunnerParameters>

View file

@ -5,6 +5,7 @@
<option name="myRunnerSettings" /> <option name="myRunnerSettings" />
<option name="myRunnerParameters"> <option name="myRunnerParameters">
<MavenRunnerParameters> <MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles"> <option name="profiles">
<set /> <set />
</option> </option>
@ -16,15 +17,20 @@
<option value="-Dlogback.configuration.file=src/main/docker/logback.xml" /> <option value="-Dlogback.configuration.file=src/main/docker/logback.xml" />
</list> </list>
</option> </option>
<option name="multimoduleDir" />
<option name="pomFileName" /> <option name="pomFileName" />
<option name="profilesMap"> <option name="profilesMap">
<map> <map>
<entry key="bundle-ui" value="true" /> <entry key="bundle-ui" value="true" />
<entry key="quick" value="true" />
<entry key="embedded-jetty" value="true" /> <entry key="embedded-jetty" value="true" />
<entry key="clean-exclude-wars" value="true" /> <entry key="clean-exclude-wars" value="true" />
<entry key="enhance" value="true" /> <entry key="enhance" value="true" />
</map> </map>
</option> </option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" /> <option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" /> <option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters> </MavenRunnerParameters>

View file

@ -5,21 +5,26 @@
<option name="myRunnerSettings" /> <option name="myRunnerSettings" />
<option name="myRunnerParameters"> <option name="myRunnerParameters">
<MavenRunnerParameters> <MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles"> <option name="profiles">
<set /> <set />
</option> </option>
<option name="goals"> <option name="goals">
<list> <list>
<option value="clean" />
<option value="process-classes" /> <option value="process-classes" />
</list> </list>
</option> </option>
<option name="multimoduleDir" />
<option name="pomFileName" /> <option name="pomFileName" />
<option name="profilesMap"> <option name="profilesMap">
<map> <map>
<entry key="quick" value="true" />
<entry key="enhance" value="true" /> <entry key="enhance" value="true" />
</map> </map>
</option> </option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" /> <option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" /> <option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters> </MavenRunnerParameters>

View file

@ -36,6 +36,7 @@
<option name="pomFileName" /> <option name="pomFileName" />
<option name="profilesMap"> <option name="profilesMap">
<map> <map>
<entry key="quick" value="true" />
<entry key="h2-console" value="true" /> <entry key="h2-console" value="true" />
<entry key="enhance" value="true" /> <entry key="enhance" value="true" />
</map> </map>
@ -50,4 +51,4 @@
</MavenSettings> </MavenSettings>
<method v="2" /> <method v="2" />
</configuration> </configuration>
</component> </component>

View file

@ -38,6 +38,7 @@
<option name="pomFileName" /> <option name="pomFileName" />
<option name="profilesMap"> <option name="profilesMap">
<map> <map>
<entry key="quick" value="true" />
<entry key="enhance" value="true" /> <entry key="enhance" value="true" />
</map> </map>
</option> </option>

2
.mvn/maven.config Normal file
View file

@ -0,0 +1,2 @@
--errors
--no-transfer-progress

View file

@ -44,13 +44,13 @@ Knowing about the core technologies used by the API server may help you with und
Build an executable JAR containing just the API server: Build an executable JAR containing just the API server:
```shell ```shell
mvn clean package -P clean-exclude-wars -P enhance -P embedded-jetty -DskipTests -Dlogback.configuration.file=src/main/docker/logback.xml mvn clean package -P quick -P clean-exclude-wars -P enhance -P embedded-jetty -Dlogback.configuration.file=src/main/docker/logback.xml
``` ```
Build an executable JAR that contains both API server and frontend (aka "bundled" distribution): Build an executable JAR that contains both API server and frontend (aka "bundled" distribution):
```shell ```shell
mvn clean package -P clean-exclude-wars -P enhance -P embedded-jetty -P bundle-ui -DskipTests -Dlogback.configuration.file=src/main/docker/logback.xml mvn clean package -P quick -P clean-exclude-wars -P enhance -P embedded-jetty -P bundle-ui -Dlogback.configuration.file=src/main/docker/logback.xml
``` ```
> When using the `bundle-ui` profile, Maven will download a [`DependencyTrack/frontend`](https://github.com/DependencyTrack/frontend) > When using the `bundle-ui` profile, Maven will download a [`DependencyTrack/frontend`](https://github.com/DependencyTrack/frontend)
@ -78,7 +78,7 @@ or environment variables. Refer to the [configuration documentation](https://doc
To build and run the API server in one go, invoke the Jetty Maven plugin as follows: To build and run the API server in one go, invoke the Jetty Maven plugin as follows:
```shell ```shell
mvn jetty:run -P enhance -Dlogback.configurationFile=src/main/docker/logback.xml mvn jetty:run -P quick -P enhance -Dlogback.configurationFile=src/main/docker/logback.xml
``` ```
> Note that the `bundle-ui` profile has no effect using this method. > Note that the `bundle-ui` profile has no effect using this method.
@ -118,7 +118,7 @@ To enable it, simply pass the additional `h2-console` Maven profile to your buil
This also works with the Jetty Maven plugin: This also works with the Jetty Maven plugin:
```shell ```shell
mvn jetty:run -P enhance -P h2-console -Dlogback.configurationFile=src/main/docker/logback.xml mvn jetty:run -P quick -P enhance -P h2-console -Dlogback.configurationFile=src/main/docker/logback.xml
``` ```
Once enabled, the console will be available at http://localhost:8080/h2-console. Once enabled, the console will be available at http://localhost:8080/h2-console.
@ -148,7 +148,7 @@ export ALPINE_DATABASE_USERNAME=dtrack
export ALPINE_DATABASE_PASSWORD=dtrack export ALPINE_DATABASE_PASSWORD=dtrack
# Launch Dependency-Track # Launch Dependency-Track
mvn jetty:run -P enhance -Dlogback.configurationFile=src/main/docker/logback.xml mvn jetty:run -P quick -P enhance -Dlogback.configurationFile=src/main/docker/logback.xml
``` ```
You can now use tooling native to your chosen RDBMS, for example [pgAdmin](https://www.pgadmin.org/). You can now use tooling native to your chosen RDBMS, for example [pgAdmin](https://www.pgadmin.org/).
@ -292,7 +292,7 @@ performed, and exceptions as that shown above are raised. If this happens, you c
enhancement like this: enhancement like this:
```shell ```shell
mvn clean process-classes -P enhance mvn process-classes -P quick -P enhance
``` ```
Now just execute the test again, and it should just work. Now just execute the test again, and it should just work.

13
pom.xml
View file

@ -751,6 +751,19 @@
</build> </build>
<profiles> <profiles>
<profile>
<id>quick</id>
<activation>
<property>
<name>quickly</name>
</property>
</activation>
<properties>
<checkstyle.skip>true</checkstyle.skip>
<jacoco.skip>true</jacoco.skip>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
<profile> <profile>
<id>clean-exclude-wars</id> <id>clean-exclude-wars</id>
<build> <build>