RypoFalem / ArmorStandEditor

Bukkit plugin to allow players to edit armorstands without commands.
GNU General Public License v2.0
19 stars 69 forks source link

Basic plugin api #27

Open Prof-Bloodstone opened 4 years ago

Prof-Bloodstone commented 4 years ago

This is just a proposal - I'm open for suggestions. This lets plugins hook into ASE and customize the wand further. I personally used the PDC to provide a custom wand that needs to be crafted/found.

Since the JUnit repo was removed, it was failing to build for me - so I've made it skip tests by default.

Are you interested in adding some sort of API for the plugin? Might be something completely different.

RoboMWM commented 4 years ago

I would not skip tests by default, but instead fix them.

Prof-Bloodstone commented 4 years ago

I would not skip tests by default, but instead fix them.

A fix would be to (partially) revert https://github.com/RypoFalem/ArmorStandEditor/commit/6535bc7bb2b4e5098727e82502dc0786ba7b3885 . The issue now is that the JUnit is missing from list of dependencies - and mvn fails without it.

RoboMWM commented 4 years ago

I don't see any tests directory - so why would mvn fail... does he have tests specified elsewhere?

Prof-Bloodstone commented 4 years ago

I don't see any tests anywhere - that's why I'm confused.

But the fact is that without my latest commit - I get:

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ armorstandeditor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /my_path/ArmorStandEditor/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) @ armorstandeditor ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ armorstandeditor ---
[INFO] Surefire report directory: /my_path/ArmorStandEditor/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NoClassDefFoundError: junit/framework/TestCase
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    at org.apache.maven.surefire.util.DefaultScanResult.loadClass(DefaultScanResult.java:131)
    at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:95)
    at org.apache.maven.surefire.junit.JUnit3Provider.scanClassPath(JUnit3Provider.java:128)
    at org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:79)
    ... 9 more
Caused by: java.lang.ClassNotFoundException: junit.framework.TestCase
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 25 more

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.866 s
[INFO] Finished at: 2020-07-13T17:58:21+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project armorstandeditor: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]
RoboMWM commented 4 years ago

What mvn goal are you running

Prof-Bloodstone commented 4 years ago

I believe I tried a lot of those - mainly package and deploy iirc. It's been some time.

RoboMWM commented 4 years ago

mvn package is what I usually use, so that's interesting if it fails, wonder how he's compiling the plugin then.