From ea8f12f2ef66449f7f68586933de0fb21e02bfa5 Mon Sep 17 00:00:00 2001
From: Jan Kozusznik <jan@kozusznik.cz>
Date: Mon, 22 Jan 2018 13:56:18 +0100
Subject: [PATCH] modify pom.xml

add dependecies into jar
---
 haas-imagej-client/pom.xml                    |  9 +++--
 haas-spim-benchmark/pom.xml                   | 26 ++++++++++++--
 .../src/main/assembly/finalJar.xml            | 36 +++++++++++++++++++
 pom.xml                                       |  4 +--
 4 files changed, 66 insertions(+), 9 deletions(-)
 create mode 100644 haas-spim-benchmark/src/main/assembly/finalJar.xml

diff --git a/haas-imagej-client/pom.xml b/haas-imagej-client/pom.xml
index 66e3de87..a1375b5d 100644
--- a/haas-imagej-client/pom.xml
+++ b/haas-imagej-client/pom.xml
@@ -79,12 +79,9 @@
 		<dependency>
 			<groupId>net.imagej</groupId>
 			<artifactId>imagej</artifactId>
+			<scope>provided</scope>
 		</dependency>
-		<!-- https://mvnrepository.com/artifact/net.imagej/imagej-legacy -->
-		<dependency>
-			<groupId>net.imagej</groupId>
-			<artifactId>imagej-legacy</artifactId>
-		</dependency>
+		
 		<dependency>
 			<groupId>cz.it4i.fiji</groupId>
 			<artifactId>haas-java-client</artifactId>
@@ -94,11 +91,13 @@
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>
+			<scope>provided</scope>
 		</dependency>
 		<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14 -->
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-simple</artifactId>
+			<scope>provided</scope>
 		</dependency>
 
 		<!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
diff --git a/haas-spim-benchmark/pom.xml b/haas-spim-benchmark/pom.xml
index 1dd91406..96674846 100644
--- a/haas-spim-benchmark/pom.xml
+++ b/haas-spim-benchmark/pom.xml
@@ -79,7 +79,7 @@
 		<dependency>
 			<groupId>net.imagej</groupId>
 			<artifactId>imagej</artifactId>
-			<scope>compile</scope>
+			<scope>provided</scope>
 		</dependency>
 
 		<dependency>
@@ -91,14 +91,36 @@
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>
+			<scope>provided</scope>
 		</dependency>
 		<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14 -->
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-simple</artifactId>
+			<scope>provided</scope>
 		</dependency>
 	</dependencies>
+
 	<build>
-		
+		<plugins>
+			<plugin>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<configuration>
+					<descriptorRefs>
+						<descriptorRef>jar-with-dependencies</descriptorRef>
+					</descriptorRefs>
+				</configuration>
+				<executions>
+					<execution>
+						<id>make-assembly</id>
+						<phase>package</phase>
+						<goals>
+							<goal>single</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+
+		</plugins>
 	</build>
 </project>
diff --git a/haas-spim-benchmark/src/main/assembly/finalJar.xml b/haas-spim-benchmark/src/main/assembly/finalJar.xml
new file mode 100644
index 00000000..7649858d
--- /dev/null
+++ b/haas-spim-benchmark/src/main/assembly/finalJar.xml
@@ -0,0 +1,36 @@
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+	<id>distribution</id>
+	<formats>
+		<format>jar</format>
+	</formats>
+<!--   to include the main jar in non transitive manner and without base directory and in expanded way -->
+	<includeBaseDirectory>false</includeBaseDirectory>
+	<dependencySets>
+		<dependencySet>
+			<useProjectArtifact>true</useProjectArtifact>
+			<useTransitiveDependencies>true</useTransitiveDependencies>
+			<unpack>true</unpack>
+			<scope>runtime</scope>
+			<fileMode>0755</fileMode>
+			<directoryMode>0755</directoryMode>
+			<includes>
+				<include>project_groupid:project_artifactid</include>
+			</includes>
+		</dependencySet>
+
+<!--  to include the dependent jars in transitive manner -->
+		<dependencySet>
+			<useProjectArtifact>false</useProjectArtifact>
+			<useTransitiveDependencies>true</useTransitiveDependencies>
+			<unpack>false</unpack>
+			<scope>runtime</scope>
+			<fileMode>0644</fileMode>
+			<directoryMode>0755</directoryMode>
+			<outputDirectory>lib</outputDirectory>
+
+			<includes></includes>
+		</dependencySet>
+	</dependencySets>
+</assembly>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 04d107eb..97f95ca8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,8 +23,8 @@
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
                     <configuration>
-                        <source>1.5</source>
-                        <target>1.5</target>
+                        <source>1.8</source>
+                        <target>1.8</target>
                     </configuration>
                 </plugin>
             </plugins>
-- 
GitLab