Skip to content

Commit

Permalink
Added option to build with maven and gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyCloudCraft committed Nov 17, 2024
1 parent 780b56b commit 9cb80db
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 222 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Grant execute permission to pom.xml
run: |
wget -q https://dlcdn.apache.org/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-bin.tar.gz
tar xzvf apache-maven-3.9.9-bin.tar.gz >/dev/null 2>&1
export PATH=./apache-maven-3.9.9/bin:$PATH
- name: Build with Maven
run: mvn package -T 1C --file pom.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ working/*
!working/server.properties
#src/**/plugin.yml
bin/
target/


# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.toVersion(project.javaVersion)
targetCompatibility = JavaVersion.toVersion(project.javaVersion)
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
base {
archivesName = "${project.pluginname}"
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Welcome, in this file you can set the variables for the builder and plugin.yml

javaVersion=21
group=de.butzlabben
pluginname=WorldSystem
authors=[Butzlabben, Trainerlord, Cycodly]
Expand Down
62 changes: 44 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<pluginname>WorldSystem</pluginname>
<group>de.butzlabben</group>
<authors>[Butzlabben, Trainerlord, Cycodly]</authors>
<description>WorldSystem plugin to create per player worlds</description>
<apiversion>1.21</apiversion>
<minecraft>1.21.3</minecraft>
<depend>[WorldEdit]</depend>
<softdepend>[PlaceholderAPI, Vault]</softdepend>
<pluginname>${project.pluginname}</pluginname>
<group>${project.group}</group>
<authors>${project.authors}</authors>
<description>${project.description}</description>
<apiversion>${project.apiversion}</apiversion>
<minecraft>${project.minecraft}</minecraft>
<depend>${project.depend}</depend>
<softdepend>${project.softdepend}</softdepend>
</properties>

<repositories>
Expand Down Expand Up @@ -72,13 +72,6 @@
<scope>provided</scope> <!-- compileOnly in Gradle entspricht 'provided' in Maven -->
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>test</scope> <!-- für Test-Annotation-Processing -->
</dependency>

<!-- Commons IO library -->
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -147,22 +140,55 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.+</version>
<version>5.11.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.+</version>
<version>5.14.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.+</version>
<version>3.26.3</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>./gradle.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
</build>
</project>
201 changes: 0 additions & 201 deletions pom.xml.old

This file was deleted.

0 comments on commit 9cb80db

Please sign in to comment.