Maven is seemingly unwilling to compile my software... 90% of the time, the other 10 or so percent it works just fine for some magical unicorn reason...
Okay, So maven complains most of the time about an incompatible type, yet the code works fine, I have thrown some invalid stuff at it (Because eclipses native compiler compiles it just fine) and i haven't had any issues with it... This is the code it refers to:
@SuppressWarnings("unchecked")
public static void registerModule(Class<? extends Module> mod) {
try {
Log.info("[Module Handler] Enabling module \"" + mod.getSimpleName() + "\"");
Module modObj = null;
if (Xmlable.class.isAssignableFrom(mod)) {
modObj = (Module) pl.unmarshal((Class<Xmlable>) mod);
if (modObj == null) {
modObj = mod.newInstance();
pl.marshal((Xmlable) modObj);
} else {
pl.marshal((Xmlable) modObj);
}
}
if (modObj == null) {modObj = mod.newInstance();}
if (modObj != null) {
registerModule(modObj);
} else {
Log.fatal("[Module Handler] Module is null!");
}
} catch (Exception e) {
Log.fatal("[Module Handler] Exception while registeringing a module class");
e.printStackTrace();
return;
}
}
And this is the error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project minesuiteus: Compilation failure
[ERROR] /**/Minevictus Suite/src/main/java/me/taucu/server/minevictus/minesuiteus/Main.java:[48,81] incompatible types: java.lang.Class<capture#1 of ? extends me.taucu.server.minevictus.minesuiteus.Module> cannot be converted to java.lang.Class<me.taucu.server.minevictus.minesuiteus.Xmlable>
[ERROR] -> [Help 1]