Skip to content

Commit

Permalink
Switched to Java 10
Browse files Browse the repository at this point in the history
Maven shade plugin and javadoc plugins have issues with Java 10 so those
are currently commented out.

BStats cannot work because shade plugin is not shading.

Shade plugin is fixed in snapshots, but not in Maven Central yet.
  • Loading branch information
tastybento committed Aug 31, 2018
1 parent 4203ce8 commit 95f8c81
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
12 changes: 7 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<java.version>1.10</java.version>

This comment has been minimized.

Copy link
@sgdc3

sgdc3 Sep 1, 2018

Contributor

NO NO NO ;-;

<powermock.version>1.7.4</powermock.version>
</properties>

Expand Down Expand Up @@ -126,7 +126,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand All @@ -142,6 +142,7 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -159,7 +160,7 @@
</goals>
</execution>
</executions>
</plugin>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand All @@ -173,10 +174,11 @@
</execution>
</executions>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<configuration>
<minimizeJar>true</minimizeJar>
<relocations>
Expand All @@ -199,7 +201,7 @@
</goals>
</execution>
</executions>
</plugin>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/world/bentobox/bentobox/BentoBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@ public void onEnable(){
instance.log("#############################################");

// Load metrics
/*
if (settings.isMetrics()) {
BStats bStats = new BStats(this);
bStats.registerMetrics();
}

*/
// Fire plugin ready event
Bukkit.getServer().getPluginManager().callEvent(new BentoBoxReadyEvent());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,24 @@ public Class<?> findClass(String name, boolean checkGlobal) {
if (name.startsWith("world.bentobox.bentobox")) {
return null;
}
Class<?> result = classes.get(name);
if (result == null) {
if (checkGlobal) {
result = loader.getClassByName(name);
}

Class<?> result = classes.computeIfAbsent(name, k -> {
if (checkGlobal && loader.getClassByName(name) != null) {
return loader.getClassByName(name);
} else {
if (result == null) {
try {
return super.findClass(name);
result = super.findClass(name);
} catch (ClassNotFoundException e) {
return null;
result = null;
}
if (result != null) {
loader.setClass(name, result);

}
}
});
if (result != null) {
loader.setClass(name, result);
classes.put(name, result);
}
return result;
}
Expand Down

4 comments on commit 95f8c81

@Poslovitch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about firstly trying to update to Java 9 and wait for Maven plugins to come out in Java 10?

@sgdc3
Copy link
Contributor

@sgdc3 sgdc3 commented on 95f8c81 Sep 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maven is 100% fine with jdk 11

@sgdc3
Copy link
Contributor

@sgdc3 sgdc3 commented on 95f8c81 Sep 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this issue about the shade plugin? never experienced that

@tastybento
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgdc3 https://issues.apache.org/jira/browse/MSHADE-289

It's fixed, but not in Maven central yet. You may know a way to get it to work. Anyway, we still need to compile for Java 8 because 98% of our users are using it.

Please sign in to comment.