mirror of
https://github.com/DependencyTrack/dependency-track.git
synced 2025-10-19 07:53:18 +00:00
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:
parent
9427d40657
commit
ec68087c4f
9 changed files with 47 additions and 14 deletions
11
.github/workflows/_meta-build.yaml
vendored
11
.github/workflows/_meta-build.yaml
vendored
|
@ -47,12 +47,11 @@ jobs:
|
|||
|
||||
- name: Build with Maven
|
||||
run: |-
|
||||
mvn -B --no-transfer-progress clean
|
||||
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 --no-transfer-progress clean -P clean-exclude-wars
|
||||
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 --no-transfer-progress clean -P clean-exclude-wars
|
||||
mvn -B --no-transfer-progress cyclonedx:makeBom -Dservices.bom.merge.skip=false org.codehaus.mojo:exec-maven-plugin:exec@merge-services-bom
|
||||
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 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 clean -P clean-exclude-wars
|
||||
mvn -B cyclonedx:makeBom -Dservices.bom.merge.skip=false org.codehaus.mojo:exec-maven-plugin:exec@merge-services-bom
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
|
||||
|
|
6
.idea/runConfigurations/Build API Server.run.xml
generated
6
.idea/runConfigurations/Build API Server.run.xml
generated
|
@ -5,6 +5,7 @@
|
|||
<option name="myRunnerSettings" />
|
||||
<option name="myRunnerParameters">
|
||||
<MavenRunnerParameters>
|
||||
<option name="cmdOptions" />
|
||||
<option name="profiles">
|
||||
<set />
|
||||
</option>
|
||||
|
@ -16,14 +17,19 @@
|
|||
<option value="-Dlogback.configuration.file=src/main/docker/logback.xml" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="multimoduleDir" />
|
||||
<option name="pomFileName" />
|
||||
<option name="profilesMap">
|
||||
<map>
|
||||
<entry key="quick" value="true" />
|
||||
<entry key="embedded-jetty" value="true" />
|
||||
<entry key="clean-exclude-wars" value="true" />
|
||||
<entry key="enhance" value="true" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="projectsCmdOptionValues">
|
||||
<list />
|
||||
</option>
|
||||
<option name="resolveToWorkspace" value="false" />
|
||||
<option name="workingDirPath" value="$PROJECT_DIR$" />
|
||||
</MavenRunnerParameters>
|
||||
|
|
6
.idea/runConfigurations/Build Bundled.run.xml
generated
6
.idea/runConfigurations/Build Bundled.run.xml
generated
|
@ -5,6 +5,7 @@
|
|||
<option name="myRunnerSettings" />
|
||||
<option name="myRunnerParameters">
|
||||
<MavenRunnerParameters>
|
||||
<option name="cmdOptions" />
|
||||
<option name="profiles">
|
||||
<set />
|
||||
</option>
|
||||
|
@ -16,15 +17,20 @@
|
|||
<option value="-Dlogback.configuration.file=src/main/docker/logback.xml" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="multimoduleDir" />
|
||||
<option name="pomFileName" />
|
||||
<option name="profilesMap">
|
||||
<map>
|
||||
<entry key="bundle-ui" value="true" />
|
||||
<entry key="quick" value="true" />
|
||||
<entry key="embedded-jetty" value="true" />
|
||||
<entry key="clean-exclude-wars" value="true" />
|
||||
<entry key="enhance" value="true" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="projectsCmdOptionValues">
|
||||
<list />
|
||||
</option>
|
||||
<option name="resolveToWorkspace" value="false" />
|
||||
<option name="workingDirPath" value="$PROJECT_DIR$" />
|
||||
</MavenRunnerParameters>
|
||||
|
|
|
@ -5,21 +5,26 @@
|
|||
<option name="myRunnerSettings" />
|
||||
<option name="myRunnerParameters">
|
||||
<MavenRunnerParameters>
|
||||
<option name="cmdOptions" />
|
||||
<option name="profiles">
|
||||
<set />
|
||||
</option>
|
||||
<option name="goals">
|
||||
<list>
|
||||
<option value="clean" />
|
||||
<option value="process-classes" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="multimoduleDir" />
|
||||
<option name="pomFileName" />
|
||||
<option name="profilesMap">
|
||||
<map>
|
||||
<entry key="quick" value="true" />
|
||||
<entry key="enhance" value="true" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="projectsCmdOptionValues">
|
||||
<list />
|
||||
</option>
|
||||
<option name="resolveToWorkspace" value="false" />
|
||||
<option name="workingDirPath" value="$PROJECT_DIR$" />
|
||||
</MavenRunnerParameters>
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
<option name="pomFileName" />
|
||||
<option name="profilesMap">
|
||||
<map>
|
||||
<entry key="quick" value="true" />
|
||||
<entry key="h2-console" value="true" />
|
||||
<entry key="enhance" value="true" />
|
||||
</map>
|
||||
|
@ -50,4 +51,4 @@
|
|||
</MavenSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
</component>
|
1
.idea/runConfigurations/Jetty.run.xml
generated
1
.idea/runConfigurations/Jetty.run.xml
generated
|
@ -38,6 +38,7 @@
|
|||
<option name="pomFileName" />
|
||||
<option name="profilesMap">
|
||||
<map>
|
||||
<entry key="quick" value="true" />
|
||||
<entry key="enhance" value="true" />
|
||||
</map>
|
||||
</option>
|
||||
|
|
2
.mvn/maven.config
Normal file
2
.mvn/maven.config
Normal file
|
@ -0,0 +1,2 @@
|
|||
--errors
|
||||
--no-transfer-progress
|
|
@ -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:
|
||||
|
||||
```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):
|
||||
|
||||
```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)
|
||||
|
@ -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:
|
||||
|
||||
```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.
|
||||
|
@ -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:
|
||||
|
||||
```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.
|
||||
|
@ -148,7 +148,7 @@ export ALPINE_DATABASE_USERNAME=dtrack
|
|||
export ALPINE_DATABASE_PASSWORD=dtrack
|
||||
|
||||
# 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/).
|
||||
|
@ -292,7 +292,7 @@ performed, and exceptions as that shown above are raised. If this happens, you c
|
|||
enhancement like this:
|
||||
|
||||
```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.
|
||||
|
|
13
pom.xml
13
pom.xml
|
@ -751,6 +751,19 @@
|
|||
</build>
|
||||
|
||||
<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>
|
||||
<id>clean-exclude-wars</id>
|
||||
<build>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue