Skip to content

Commit

Permalink
TASK-4017 the maven setup does now not contain the wrapper anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf2323 committed Mar 14, 2024
1 parent 6a651d4 commit 2f119eb
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 50 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build
on:
push:
branches:
- '**'
tags-ignore:
- '**'

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java and Maven
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
server-id: 'ReLoAd'
server-username: ${{ secrets.MAVEN_SERVER_USERNAME }}
server-password: ${{ secrets.MAVEN_SERVER_PASSWORD }}
- name: Build with Maven verify
if: "github.ref != 'refs/heads/main'"
run: ./mvnw -B verify
- name: Build with Maven deploy
if: "github.ref == 'refs/heads/main'"
run: ./mvnw -B deploy
File renamed without changes.
3 changes: 1 addition & 2 deletions settings.xml → .mvn/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<mirrors>
<mirror>
<id>ReLoAd-Mirror</id>
<url>https://nexus.reloadkube.managedservices.resilient-teched.com/repository/default/
</url>
<url>https://nexus.reloadkube.managedservices.resilient-teched.com/repository/default/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
distributionUrl=https://nexus.reloadkube.managedservices.resilient-teched.com/repository/default//org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://nexus.reloadkube.managedservices.resilient-teched.com/repository/default//org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
6 changes: 0 additions & 6 deletions Base/config.iml

This file was deleted.

File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions Base/Configs/pom.xml → Configs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
<parent>
<groupId>works.reload</groupId>
<artifactId>versions</artifactId>
<version>1.0.0</version>
<version>${revision}</version>
<relativePath>../Versions/pom.xml</relativePath>
</parent>

<artifactId>configs</artifactId>
<version>1.0.0</version>
<name>Configs</name>
<description>Global configurations for java tooling</description>

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ help: ## This help.

# Updates of third-party dependencies
update-dependencies: ## Update Maven dependencies and plugins which have versions defined in properties
cd Base && ../mvnw --projects :base,:versions clean versions:update-properties
./mvnw --projects :base,:versions clean versions:update-properties

update-snapshot-dependencies: ## Update locked snapshot versions with the latest available one in the POM
cd Base && ../mvnw --projects :base,:versions versions:unlock-snapshots versions:lock-snapshots
./mvnw --projects :base,:versions versions:unlock-snapshots versions:lock-snapshots
51 changes: 19 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
# MavenSetup
A basic setup for all maven projects containing a build and tools for java.
A basic setup for all maven projects containing building and tools for java.

## Howto setup
1. Execute the following command in the root directory of your project:
```bash
git submodule add --name MavenSetup [email protected]:ResilientGroup/MavenSetup.git .mvn
# or if you have a fork under your namespace
git submodule add --name MavenSetup ../MavenSetup.git .mvn
```
2. Add the `branch = .` line to your .gitmodules file for the MavenSetup submodule. It should look like this:
```properties
[submodule="MavenSetup"]
path = .mvn
url = ../MavenSetup.git
branch = .
```
3. Add the following to your pom.xml:
````xml
<project>
<parent>
<groupId>works.reload</groupId>
<artifactId>base</artifactId>
<version>1.0.0</version>
<relativePath>.mvn/Base/pom.xml</relativePath>
</parent>
1. Add the following to your pom.xml:
````xml
<project>
<parent>
<groupId>works.reload</groupId>
<artifactId>base</artifactId>
<version>1.0.0</version>
<relativePath>.mvn/Base/pom.xml</relativePath>
</parent>

<!-- Only add this if you have a parent pom with packaging pom -->
<modules>
<module>.mvn/Base</module>
<!-- Add your modules here -->
</modules>
</project>
````
<repositories>
<repository>
<id>ReLoAd</id>
<url>https://nexus.reloadkube.managedservices.resilient-teched.com/repository/reload/</url>
</repository>
</repositories>
</project>
````

## Maven Wrapper Note
As this setup enforces a minimum maven version,
it is not guaranteed that the maven version you have installed on your system is compatible with the project.
For that, a maven wrapper is included in the setup.
This means you can use the `.mvn/mvnw` command instead of `mvn` to execute maven commands.
For that, a maven wrapper is recommended to be used.

It is strongly recommended to use the wrapper in any automated build process, as it ensures that the correct maven version is used.
7 changes: 6 additions & 1 deletion Base/Versions/pom.xml → Versions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>works.reload</groupId>
<artifactId>versions</artifactId>
<version>1.0.0</version>
<version>${revision}</version>
<packaging>pom</packaging>
<name>Versions</name>
<description>All default maven versions</description>
Expand All @@ -17,6 +17,7 @@
</organization>

<properties>
<revision>1.0.0</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
Expand All @@ -34,6 +35,10 @@
</properties>

<distributionManagement>
<repository>
<id>ReLoAd</id>
<url>https://nexus.reloadkube.managedservices.resilient-teched.com/repository/reload/</url>
</repository>
<site>
<id>${project.artifactId}-site</id>
<url>file:///tmp/dummy-site</url>
Expand Down
Empty file modified mvnw
100755 → 100644
Empty file.
5 changes: 2 additions & 3 deletions Base/pom.xml → pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
<parent>
<groupId>works.reload</groupId>
<artifactId>versions</artifactId>
<version>1.0.0</version>
<version>${revision}</version>
<relativePath>./Versions/pom.xml</relativePath>
</parent>

<artifactId>base</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>Base</name>
<description>Global configurations for java projects and code validation tools</description>
Expand Down Expand Up @@ -321,7 +320,7 @@
<configuration>
<rules>
<requireMavenVersion>
<version>3.8.1</version>
<version>3.9.6</version>
</requireMavenVersion>
</rules>
</configuration>
Expand Down

0 comments on commit 2f119eb

Please sign in to comment.