Skip to content

Commit

Permalink
Merge pull request #16 from MCME/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
EriolEandur committed Dec 5, 2021
2 parents d68f2ef + 39a14e5 commit 71b2274
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 2,031 deletions.
78 changes: 54 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.mcmiddleearth</groupId>
<artifactId>plugin-dynamic-books</artifactId>
<version>2.0</version>
<version>2.1.0</version>
<packaging>jar</packaging>

<name>Dynamic Books for MCME</name>
Expand All @@ -29,19 +29,13 @@
<target>${java.version}</target>
</configuration>
</plugin>
<!-- Did not remove this plugin since it is easily used for local development. Can remove when required -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<outputDirectory>${project.basedir}/../minecraft-server/plugins</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -50,14 +44,52 @@
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<finalName>${project.artifactId}</finalName>
<artifactSet>
<includes>
<include>com.sun.xml.bind:*</include>
<include>jakarta.xml.bind:*</include>
<include>com.sun.activation:jakarta.activation</include>
</includes>
</artifactSet>
<transformers>
<!-- JAXB uses service file to indicate which class should be used as context factory -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<relocations>
<relocation>
<pattern>com.sun.xml</pattern>
<shadedPattern>dynamicbooks.com.sun.xml</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.istack</pattern>
<shadedPattern>dynamicbooks.com.sun.istack</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.activation</pattern>
<shadedPattern>dynamicbooks.com.sun.activation</shadedPattern>
</relocation>
<relocation>
<pattern>jakarta.xml.bind</pattern>
<shadedPattern>dynamicbooks.jakarta.xml.bind</shadedPattern>
</relocation>
<relocation>
<pattern>jakarta.activation</pattern>
<shadedPattern>dynamicbooks.jakarta.activation</shadedPattern>
</relocation>
<relocation>
<pattern>org.glassfish.jaxb</pattern>
<shadedPattern>dynamicbooks.org.glassfish.jaxb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.5.0</version>
<groupId>com.evolvedbinary.maven.mojohaus</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>xjc</id>
Expand All @@ -69,8 +101,8 @@
<configuration>
<!-- Set the package of the generated code -->
<packageName>com.mcmiddleearth.plugins.dynamicbooks.jaxb</packageName>
<clearOutputDir>false</clearOutputDir>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<clearOutputDir>true</clearOutputDir>
<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
</configuration>
</plugin>
</plugins>
Expand All @@ -80,6 +112,7 @@
<filtering>true</filtering>
<includes>
<include>plugin.yml</include>
<include>jaxb.properties</include>
<include>config.yml</include>
</includes>
</resource>
Expand Down Expand Up @@ -127,22 +160,19 @@
<version>1.18.10</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.mojo/jaxb2-maven-plugin -->
<!-- JAXB API v3.0.1 -->
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.5.0</version>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
</dependency>

<!-- JAXB v3.0.2 reference implementation (curiously with com.sun coordinates) -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
<version>3.0.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;

public final class DynamicBooksPlugin extends JavaPlugin {
Expand Down Expand Up @@ -62,6 +64,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
commandDispatcher.execute(commandDispatcher.parse(label, (Player) sender));
}
} catch (CommandSyntaxException e) {
Logger.getLogger(DynamicBooksPlugin.class.getName()).log(Level.SEVERE, "Hullo!", e);
e.printStackTrace();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import org.bukkit.entity.Player;

import java.util.logging.Logger;

public class BookCommand extends CommandDispatcher<Player> {

private final BookLibrary bookLibrary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public String parse(StringReader reader) throws CommandSyntaxException {
if (options.contains(o)) {
return o;
}
throw new CommandSyntaxException(new SimpleCommandExceptionType(new LiteralMessage("Failed parsing during action evaluation")), new LiteralMessage("Failed parsing during action evaluation on action:" + o));
throw new CommandSyntaxException(new SimpleCommandExceptionType(new LiteralMessage("Failed parsing during book evaluation")), new LiteralMessage("Failed parsing during action evaluation on action:" + o));
}

@Override
Expand Down

This file was deleted.

0 comments on commit 71b2274

Please sign in to comment.