Prechádzať zdrojové kódy

Getting maven to work, finally.

Sam Jaffe 8 rokov pred
rodič
commit
6ebb52a178

+ 50 - 5
pom.xml

@@ -4,6 +4,9 @@
 	<groupId>samjaffe</groupId>
 	<artifactId>d20-charsheet</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+	</properties>
 	<build>
 		<pluginManagement>
 			<plugins>
@@ -59,9 +62,41 @@
 				</executions>
 				<configuration>
 					<addOutputDirectory>false</addOutputDirectory>
-					<encoding>UTF-8</encoding>
 				</configuration>
 			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<archive>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<mainClass>org.leumasjaffe.charsheet.Test</mainClass>
+							<classpathPrefix>dependency-jars/</classpathPrefix>
+						</manifest>
+					</archive>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<version>2.5.1</version>
+				<executions>
+					<execution>
+						<id>copy-dependencies</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>
+								${project.build.directory}/dependency-jars/
+							</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
 		</plugins>
 	</build>
 	<dependencies>
@@ -97,10 +132,20 @@
 			<version>1.6.1</version>
 		</dependency>
 		<dependency>
-		    <groupId>junit</groupId>
-		    <artifactId>junit</artifactId>
-		    <version>4.12</version>
-		    <scope>test</scope>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.12</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.logging.log4j</groupId>
+			<artifactId>log4j-api</artifactId>
+			<version>2.8.2</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.logging.log4j</groupId>
+			<artifactId>log4j-core</artifactId>
+			<version>2.8.2</version>
 		</dependency>
 	</dependencies>
 </project>

+ 4 - 5
src/main/lombok/org/leumasjaffe/charsheet/config/Constants.java

@@ -1,20 +1,19 @@
 package org.leumasjaffe.charsheet.config;
 
-import lombok.AccessLevel;
 import lombok.experimental.FieldDefaults;
 import lombok.experimental.UtilityClass;
 
 @UtilityClass
-@FieldDefaults(level=AccessLevel.PUBLIC, makeFinal=true)
+@FieldDefaults(makeFinal=true) // level is not correctly handled when delomboking in maven builds
 public final class Constants {
-	static String NO_FLAT_FOOTED = "Keeps Dexterity When Flat-footed";
+	public String NO_FLAT_FOOTED = "Keeps Dexterity When Flat-footed";
 	
-	String K_DISTANCE = "Distance Measurement Unit";
+	public String K_DISTANCE = "Distance Measurement Unit";
 	public enum DistanceMeasurement {
 		FEET, SQUARES
 	}
 	
-	String K_DURATION = "Duration Display Unit";
+	public String K_DURATION = "Duration Display Unit";
 	public enum DurationMeasurement {
 		NATURAL, ROUNDS
 	}