From e5c8bec62bef8e9d42579de21c6c7822a70b837e Mon Sep 17 00:00:00 2001 From: asofold Date: Wed, 10 Jan 2018 01:54:08 +0100 Subject: [PATCH] Obtain the "non free" modules via a pre-built jar by default. This way testing changes to the core checks will be easier: * By default NCPCompatNonFree is fetched from the repository (prevent via -Dno_nonfree). * To build "non free" modules, -P nonfree_build is needed. In addition you need to specify the profiles for what to build, such as -P all an the like. --- NCPCompatNonFree/pom.xml | 7 ++- NCPCompatNonFreeJar/pom.xml | 86 +++++++++++++++++++++++++++++++++++++ NCPPlugin/pom.xml | 50 ++++++++++++++++++--- README.md | 27 +++++++----- pom.xml | 13 +++++- 5 files changed, 161 insertions(+), 22 deletions(-) create mode 100644 NCPCompatNonFreeJar/pom.xml diff --git a/NCPCompatNonFree/pom.xml b/NCPCompatNonFree/pom.xml index 3d7fc4f7..dad4c3db 100644 --- a/NCPCompatNonFree/pom.xml +++ b/NCPCompatNonFree/pom.xml @@ -20,6 +20,7 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti 1.1-SNAPSHOT + pom @@ -48,6 +49,7 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti NCPCompatSpigotCB1_9_R2 NCPCompatSpigotCB1_10_R1 NCPCompatSpigotCB1_11_R1 + NCPCompatCBDev @@ -57,6 +59,7 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti ncpcompatcbdev 1.1-SNAPSHOT + fr.neatmonster ncpcompatspigotcb1_11_r1 @@ -174,6 +177,8 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti + + spigot1_12_r1 @@ -274,7 +279,6 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti - @@ -287,5 +291,4 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti - pom diff --git a/NCPCompatNonFreeJar/pom.xml b/NCPCompatNonFreeJar/pom.xml new file mode 100644 index 00000000..099babf5 --- /dev/null +++ b/NCPCompatNonFreeJar/pom.xml @@ -0,0 +1,86 @@ + + + 4.0.0 + fr.neatmonster + ncpcompatnonfreejar + 1.2-SNAPSHOT + NCPCompatNonFreeJar + Create a jar from NCPCompatNonFree. + + fr.neatmonster + nocheatplus-parent + 1.1-SNAPSHOT + + + + + fr.neatmonster + ncpcompatnonfree + 1.1-SNAPSHOT + pom + + + + + + + nonfree_build + + + md_5-releases + https://repo.md-5.net/content/repositories/releases/ + + + md_5-snapshots + https://repo.md-5.net/content/repositories/snapshots/ + + + + + clean package + ../../target + NCPCompatNonFree + + + org.apache.maven.plugins + maven-shade-plugin + 1.4 + + + package + + shade + + + + + fr.neatmonster:* + + + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + + + + + + + + + + + + + diff --git a/NCPPlugin/pom.xml b/NCPPlugin/pom.xml index 7bf507e3..8a43ef6d 100644 --- a/NCPPlugin/pom.xml +++ b/NCPPlugin/pom.xml @@ -48,15 +48,51 @@ For the plugin/artifact version see the NoCheatPlus module. ncpcompatprotocollib 1.1-SNAPSHOT - - - fr.neatmonster - ncpcompatnonfree - 1.1-SNAPSHOT - pom - + + + + + nonfree_build + + + fr.neatmonster + ncpcompatnonfree + 1.1-SNAPSHOT + compile + pom + + + fr.neatmonster + ncpcompatnonfreejar + 1.2-SNAPSHOT + + jar + + + + + + nonfree_include + + + !no_nonfree + + + + + fr.neatmonster + ncpcompatnonfreejar + 1.2-SNAPSHOT + + jar + + + + + + diff --git a/README.md b/README.md index 4bbaa335..4e2972e3 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Compiling NoCheatPlus --------- * NoCheatPlus used to be compiled with java 6 compliance (note OpenJDK, possibly we'll switch to 8 directly, once appropriate, e.g. with ProtocolLib dropping support for 7.). * We use [Maven](http://maven.apache.org/download.cgi) 3 to handle the dependencies. -* You can compile with this Maven goal: `mvn clean package`, if you don't want any dedicated CraftBukkit modules, or if you are lacking the jar files - **for best performance and compatibility, choose the appropriate build profile(s) from below**. If you do have all the legacy dependencies, you can activate the profile `all` adding `-P all` to the maven goals. For more options, see the table below. If your specific needs are not met by the provided options, you can still build only using the compat module(s) that you need, e.g. by adjusting the build/dependency profiles or adding your own profile, which means changing/adding a profile both in the root pom.xml for modules to have and in NCPPlugin/pom.xml for the dependency inclusion. The preset profiles should be enough of a hint for that. If you add custom modules with a different package naming than `fr.neatmonster`, you might have to add the source inclusion to the NoCheatPlus/pom.xml as well. +* You can compile with this Maven goal: `mvn clean package`, for a standard build. To also (re-) build "non free" compatibility modules that depend on Spigot or the like, Maven profiles can be chosen. For reference on profiles see the table below. See the NCPCompatNonFree sub module for reference on how to add custom modules. If you add custom modules with a different package naming than `fr.neatmonster`, you might have to add the source inclusion to the NoCheatPlus/pom.xml as well. * Jar files for the dedicated compat modules, which your local maven repository might be missing, can be installed manually. Example for Eclipse with embedded maven: Add a new maven build run configuration, name it appropriately, e.g. ```Install CB 1.7.5```. @@ -28,23 +28,28 @@ Set goals to: ```install:install-file -Dfile= -DgroupId=org.bukkit On Windows the might look like: ```X:\...\craftbukkit\3042\craftbukkit-1.7.5-R0.1-20140408.020329-16.jar``` To let it run you might have to set the base directory, e.g. to ```${workspace_loc}```, it does not seem to have significance. Do set the correct version alongside the file name. On newer version of maven, you might do with much simplified goals, because the pom files inside the jars are parsed. - * **The latest versions of BuildTools.jar will automatically install the necessary server jars into the local .m2 repository (e.g. on linux) - provided configuration paths are standard. Thus you don't need to do this manually anymore, if you then build NCP with the specific profile, if you have run BuildTools.jar to generate the server jars on that machine/environment.** + * **The latest versions of BuildTools.jar will automatically install the created server jars into the local .m2 repository (e.g. on linux) - provided configuration paths are standard. Thus you don't need to do this manually anymore, if you then build NCP with the specific profile, if you have run BuildTools.jar to generate the server jars on that machine/environment.** -All profiles for reference: +Options and profiles related to enabling/disabling including/building "non free" compatibility modules. -**Maven profiles remain for selection of compatibility modules, activation parameters have been removed, ncp_base has been removed.** +| Profile | Parameter | Description | +| :------------------ | :-------------- | :-------------- | +| _none_ | _none_ | The "non free" modules are included via a pre-built jar file from the repository. | +| -P nonfree_build | _none_ | Enable building "non free" compatibility modules. The NCPCompatNonFree jar file is built/installed/(deployed). | +| _none_ | -Dno_nonfree | The "non free" modules are neither built, nor included via a pre-built jar file. | + +Profiles for choice of "non free" compatibility modules to build: | Profile | Description | | :------------------ | :-------------- | | _none_ | Default build without any of the native access modules, might pose compatibility issues with latest Minecraft versions. The reflection based module is included here. | | `-P all` | All compatibility modules. | -| `-P spigot1_7_r4` | Just Spigot 1.7 R4 (MC 1.7.10). | -| `-P spigot1_8_r3` | Just Spigot 1.8 R3 (MC 1.8.4-1.8.8). | -| `-P spigot1_9_r1` | Just Spigot 1.9 R1 (MC 1.9-1.9.3). | -| `-P spigot1_9_r2` | Just Spigot 1.9 R2 (MC 1.9.4). | -| `-P spigot1_10_r1` | Just Spigot 1.10 R1 (MC 1.10-1.10.2). | -| `-P spigot1_11_r1` | Just Spigot 1.11 R1 (MC 1.11-1.11.2). | -| `-P spigot1_12_r1` | Just Spigot 1.12 R1 (MC 1.12-1.12.2). | +| `-P spigot1_7_r4` | Spigot 1.7 R4 (MC 1.7.10). | +| `-P spigot1_8_r3` | Spigot 1.8 R3 (MC 1.8.4-1.8.8). | +| `-P spigot1_9_r2` | Spigot 1.9 R2 (MC 1.9.4). | +| `-P spigot1_10_r1` | Spigot 1.10 R1 (MC 1.10-1.10.2). | +| `-P spigot1_11_r1` | Spigot 1.11 R1 (MC 1.11-1.11.2). | +| `-P spigot1_12_r1` | Spigot 1.12 R1 (MC 1.12-1.12.2). | | `-P cbdev` | The latest version in development. | (On the long run, only the latest module for a major Minecraft release may be be kept, such as 1_8_r3 for all of 1.8.x.) diff --git a/pom.xml b/pom.xml index c2b23ecf..d9d9a83d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,10 +24,19 @@ NCPCompatProtocolLib NCPPlugin NoCheatPlus - - NCPCompatNonFree + + + + nonfree_build + + NCPCompatNonFree + NCPCompatNonFreeJar + + + + spigot-repo