Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titlePOM with JUNIT test and debugging JS7 Jobs
collapsetrue
<project xmlns="http://maven.apache.org/POM/4.0.0"
	    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	    <modelVersion>4.0.0</modelVersion>
	    <groupId>com.sos-berlin</groupId>
	    <artifactId>js7jobs</artifactId>
	    <version>0.0.1-SNAPSHOT</version>
 
	    <properties>
		        <!-- release version of js7 jars -->
		        <sos.js7.version>2.6.1</sos.js7.version>
		        <!-- 3rd party versions -->
		        <scala.library.version>2.13.11</scala.library.version>
		        <slf4j.version>1.7.36</slf4j.version>
		        <io.vavr.version>0.10.4</io.vavr.version>
		        <!-- JS7 3rd party test versions -->
		        <javax.json.version>1.0.2</javax.json.version>
		<log4j        <log4j.version>2.20.0</log4j.version>
		        <junit.version>4.8.2</junit.version>
		        <sourcecode.version>0.3.0</sourcecode.version>
		        <circe.version>0.14.3</circe.version>
		        <jackson.databind.version>2.14.2</jackson.databind.version>

		        
        <!-- groupId and artifactIds of js7 jars -->
		<sos.js7.groupId>com.sos-berlin</sos.js7.groupId>
		<sos.js7.job.artifactId>sos-js7-job</sos.js7.job.artifactId>
		<sos.js7.commons.util.artifactId>sos-commons-util</sos.js7.commons.util.artifactId>
		<sos.js7.commons.exception.artifactId>sos-commons-exception</sos.js7.commons.exception.artifactId>
		 JS7 3rd party SOSApiRestclient versions --> 
        <!--
        <httpclient.version>4.5.13</httpclient.version>
        <httpcore.version>4.4.16</httpcore.version>
        <jakarta.api.version>3.0.0</jakarta.api.version>
        -->

        <!-- groupId and artifactIds of js7 jars -->
        <sos.js7.groupId>com.sos-berlin</sos.js7.groupId>
        <sos.js7.job.artifactId>sos-js7-job</sos.js7.job.artifactId>
        <sos.js7.commons.util.artifactId>sos-commons-util</sos.js7.commons.util.artifactId>
        <sos.js7.commons.exception.artifactId>sos-commons-exception</sos.js7.commons.exception.artifactId>
        <sos.js7.commons.httpclient.artifactId>sos-commons-httpclient</sos.js7.commons.httpclient.artifactId>

		 
        <sos.js7.engine.groupId>com.sos-berlin.js7.engine</sos.js7.engine.groupId>
		        <sos.js7.launcher.artifactId>js7-launcher-for-java</sos.js7.launcher.artifactId>
		        <sos.js7.data-for-java.artifactId>js7-data-for-java</sos.js7.data-for-java.artifactId>
		        <sos.js7.base.artifactId>js7-base</sos.js7.base.artifactId>
		        <!-- sos jars for tests -->
		        <sos.js7.commons.hibernate.artifactId>sos-commons-hibernate</sos.js7.commons.hibernate.artifactId>
		        <sos.js7.commons.vfs.artifactId>sos-commons-vfs</sos.js7.commons.vfs.artifactId>
		        <sos.js7.commons.sign.artifactId>sos-commons-sign</sos.js7.commons.sign.artifactId>
		        <sos.js7.data.artifactId>js7-data</sos.js7.data.artifactId>
		 
		          
        <!-- directories with js7 jars to install the local project repository -->
		        <sos.js7.external.srcdir>${project.basedir}/sos</sos.js7.external.srcdir>
	    </properties>
 
	    <repositories>

		 
        <!-- public repository for 3rd party jars -->
		<repository>
			        <repository>
            <id>central</id>
			            <name>Central Repository</name>
			            <url>https://repo1.maven.org/maven2</url>
			<snapshots>
				<enabled>false</enabled>
				<updatePolicy>never</updatePolicy>
			</snapshots>
		</repository>
	</repositories>

	<dependencies>
		            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </repository>
    </repositories>
 
    <dependencies>
        <!-- SOS dependencies -->
		<dependency>
			        <dependency>
            <groupId>${sos.js7.engine.groupId}</groupId>
			            <artifactId>${sos.js7.launcher.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>provided</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>${sos.js7.engine.groupId}</groupId>
			            <artifactId>${sos.js7.data-for-java.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>provided</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>${sos.js7.engine.groupId}</groupId>
			            <artifactId>${sos.js7.base.artifactId}</artifactId>
			<version>${sos.            <version>${sos.js7.version}</version>
			            <scope>provided</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>${sos.js7.groupId}</groupId>
			            <artifactId>${sos.js7.job.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>provided</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>${sos.js7.groupId}</groupId>
			            <artifactId>${sos.js7.commons.util.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>provided</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>${sos.js7.groupId}</groupId>
			            <artifactId>${sos.js7.commons.exception.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>provided</scope>
		        </dependency>
		
		         
        <!-- Example for a custom dependency -->
		        <!--
          <dependency>
			            <groupId>${sos.js7.groupId}</groupId>
			            <artifactId>${sos.js7.commons.httpclient.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			<scope>provided</scope>
		            <scope>provided</scope>
        </dependency>
        
        
        -->

		 
        <!-- SOS test dependencies -->
		<dependency>
			        <dependency>
            <groupId>${sos.js7.groupId}</groupId>
			            <artifactId>${sos.js7.commons.hibernate.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>test</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>${sos.js7.groupId}</groupId>
			            <artifactId>${sos.js7.commons.vfs.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>test</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>${sos.js7.groupId}</groupId>
			<artifactId>${            <artifactId>${sos.js7.commons.sign.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>test</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>${sos.js7.engine.groupId}</groupId>
			            <artifactId>${sos.js7.data.artifactId}</artifactId>
			            <version>${sos.js7.version}</version>
			            <scope>test</scope>
		        </dependency>
				
		                 
        <!-- 3rd Party -->
		<dependency>
			        <dependency>
            <groupId>org.scala-lang</groupId>
			            <artifactId>scala-library</artifactId>
			            <version>${scala.library.version}</version>
			            <scope>provided</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>io.vavr</groupId>
			            <artifactId>vavr</artifactId>
			            <version>${io.vavr.version}</version>
			            <scope>provided</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>org.slf4j</groupId>
			            <artifactId>slf4j-api</artifactId>
			            <version>${slf4j.version}</version>
			            <scope>provided</scope>
		        </dependency>
		
		         
        <!-- 3rd party test dependencies -->
       	 <dependency>
			            <groupId>junit</groupId>
			            <artifactId>junit</artifactId>
			            <version>${junit.version}</version>
			            <scope>test</scope>
		<        </dependency>
		<dependency>
			        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
			            <artifactId>log4j-core</artifactId>
			            <version>${log4j.version}</version>
			            <scope>test</scope>
		        </dependency>
		        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
			            <version>${log4j.version}</version>
			<scope>test</scope>
          </dependency>
		<dependency>
			  <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.circe</groupId>
			            <artifactId>circe-core_2.13</artifactId>
			            <version>${circe.version}</version>
			            <scope>test</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>io.circe</groupId>
			            <artifactId>circe-generic_2.13</artifactId>
			            <version>${circe.version}</version>
			            <scope>test</scope>
		        </dependency>
		<dependency>
			        <dependency>
            <groupId>com.lihaoyi</groupId>
			            <artifactId>sourcecode_2.13</artifactId>
			            <version>${sourcecode.version}</version>
			<scope>test</scope>
		            <scope>test</scope>
        </dependency>
  	</dependencies>

	<profiles><dependency>
		<profile>
			<id>create-local-repo</id>	<groupId>com.fasterxml.jackson.core</groupId>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-install-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>install-${sos.js7.launcher.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									<file>${sos.js7.external.srcdir}/${sos.js7.engine.groupId}.${sos.js7.launcher.artifactId}-${sos.js7.version}.jar</file>
									<groupId>${sos.js7.engine.groupId}</groupId>
									<artifactId>${sos.js7.launcher.artifactId}</artifactId>
									<version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>
							<execution>
								<id>install-${sos.js7.data-for-java.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									<file>${sos.js7.external.srcdir}/${sos.js7.engine.groupId}.${sos.js7.data-for-java.artifactId}-${sos.js7.version}.jar</file>
									<groupId>${sos.js7.engine.groupId}</groupId>
									<artifactId>${sos.js7.data-for-java.artifactId}</artifactId>
									<version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>
							<execution>
								<id>install-${sos.js7.base.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									<artifactId>jackson-databind</artifactId>
            <version>${jackson.databind.version}</version>
            <scope>test</scope>
		</dependency>        
		
        <!-- JS7 3rd party SOSApiRestclient dependencies --> 
        <!--
  		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
            <version>${httpclient.version}</version>
            <scope>test</scope>
		</dependency>        
  		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
            <version>${httpcore.version}</version>
            <scope>test</scope>
		</dependency>        
  		<dependency>
			<groupId>jakarta.ws.rs</groupId>
			<artifactId>jakarta.ws.rs-api</artifactId>
            <version>${jakarta.api.version}</version>
            <scope>test</scope>
		</dependency>     
		-->   
    </dependencies>
 
    <profiles>
        <profile>
            <id>create-local-repo</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-install-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>install-${sos.js7.launcher.artifactId}</id>
                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.engine.groupId}.${sos.js7.baselauncher.artifactId}-${sos.js7.version}.jar</file>
									                                    <groupId>${sos.js7.engine.groupId}</groupId>
									                                    <artifactId>${sos.js7.baselauncher.artifactId}</artifactId>
									                                    <version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>

							<execution>
								<id>install-${sos.js7.job.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									<file>${sos.js7.external.srcdir}/${sos.js7.job.artifactId}-${sos.js7.version}.jar</file>
									<groupId>${sos.js7.groupId}</groupId>
									<artifactId>${sos.js7.job.artifactId}</artifactId>
									<version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>
							<execution>
								<id>install-${sos.js7.commons.util.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									<file>${sos.js7.external.srcdir}/${sos.js7.commons.util.artifactId}-${sos.js7.version}.jar</file>
									<groupId>${sos.js7.groupId}</groupId>
									<artifactId>${sos.js7.commons.util.artifactId}</artifactId>
									<version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>

							<execution>
								<id>install-${sos.js7.commons.httpclient.artifactId}</id>
					 			<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									                                    <packaging>jar</packaging>
                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
                            <execution>
                                <id>install-${sos.js7.data-for-java.artifactId}</id>
                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.engine.groupId}.${sos.js7.data-for-java.artifactId}-${sos.js7.version}.jar</file>
                                    <groupId>${sos.js7.engine.groupId}</groupId>
                                    <artifactId>${sos.js7.data-for-java.artifactId}</artifactId>
                                    <version>${sos.js7.version}</version>
                                    <packaging>jar</packaging>
                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
                            <execution>
                                <id>install-${sos.js7.base.artifactId}</id>
                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.commons.httpclient.engine.groupId}.${sos.js7.base.artifactId}-${sos.js7.version}.jar</file>
									                                    <groupId>${sos.js7.engine.groupId}</groupId>
									<artifactId>${sos.js7.commons.httpclient.artifactId}</artifactId>
									                                    <artifactId>${sos.js7.base.artifactId}</artifactId>
                                    <version>${sos.js7.version}</version>
									<packaging>jar</packaging>								
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>
							<execution>
								<id>install-                                    <packaging>jar</packaging>
                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
 
                            <execution>
                                <id>install-${sos.js7.job.artifactId}</id>
                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.job.artifactId}-${sos.js7.version}.jar</file>
                                    <groupId>${sos.js7.groupId}</groupId>
                                    <artifactId>${sos.js7.job.artifactId}</artifactId>
                                    <version>${sos.js7.version}</version>
                                    <packaging>jar</packaging>
                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
                            <execution>
                                <id>install-${sos.js7.commons.util.artifactId}</id>
                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.commons.util.artifactId}-${sos.js7.version}.jar</file>
                                    <groupId>${sos.js7.groupId}</groupId>
                                    <artifactId>${sos.js7.commons.util.artifactId}</artifactId>
                                    <version>${sos.js7.version}</version>
                                    <packaging>jar</packaging>
                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
 
                            <!-- JS7 copy Jar for SOSApiRestclient --> 
                            <!--

                            <execution>
                                <id>install-${sos.js7.commons.httpclient.artifactId}</id>
                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.commons.httpclient.artifactId}-${sos.js7.version}.jar</file>
                                    <groupId>${sos.js7.groupId}</groupId>
                                    <artifactId>${sos.js7.commons.httpclient.artifactId}</artifactId>
                                    <version>${sos.js7.version}</version>
                                    <packaging>jar</packaging>                             
                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
                            -->
                            <execution>
                                <id>install-${sos.js7.commons.exception.artifactId}</id>
                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.commons.exception.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									<file>${sos.js7.external.srcdir}/$-${sos.js7.version}.jar</file>
                                    <groupId>${sos.js7.groupId}</groupId>
                                    <artifactId>${sos.js7.commons.exception.artifactId}-$.exception.artifactId}</artifactId>
                                    <version>${sos.js7.version}.jar<</file>
									<groupId>${sos.js7.groupId}</groupId>
									<artifactId>${sos.js7.commons.exception.artifactId}</artifactId>
									<version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									<localRepositoryPath>${sos.js7.local.repodir}</localRepositoryPath>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>
version>
                                    <packaging>jar</packaging>
                                    <localRepositoryPath>${sos.js7.local.repodir}</localRepositoryPath>
                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
 
                            <!-- SOS Jars for testing-->
                            <execution>
                                <id>install-${sos.js7.commons.hibernate.artifactId}</id>
                                <goals>
                                    <goal>install-file</goal>
                            <!-- SOS Jars for testing-->
							<execution>
								<id>install-${sos.js7.commons.hibernate.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									</goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.commons.hibernate.artifactId}-${sos.js7.version}.jar</file>
									.js7.version}.jar</file>
                                    <groupId>${sos.js7.groupId}</groupId>
									                                    <artifactId>${sos.js7.commons.hibernate.artifactId}</artifactId>
									                                    <version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									                                    <packaging>jar</packaging>
                                    <localRepositoryPath>${sos.js7.local.repodir}</localRepositoryPath>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>
							<execution>
								                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
                            <execution>
                                <id>install-${sos.js7.commons.sign.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.commons.sign.artifactId}-${sos.js7.version}.jar</file>
									<groupId>${sos.js7.groupId}</groupId>
									                                    <groupId>${sos.js7.groupId}</groupId>
                                    <artifactId>${sos.js7.commons.sign.artifactId}</artifactId>
									                                    <version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									                                    <packaging>jar</packaging>
                                    <localRepositoryPath>${sos.js7.local.repodir}</localRepositoryPath>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>
							<execution>
								
                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
                            <execution>
                                <id>install-${sos.js7.commons.vfs.artifactId}</id>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									                                <goals>
                                    <goal>install-file</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <file>${sos.js7.external.srcdir}/${sos.js7.commons.vfs.artifactId}-${sos.js7.version}.jar</file>
									                                    <groupId>${sos.js7.groupId}</groupId>
									                                    <artifactId>${sos.js7.commons.vfs.artifactId}</artifactId>
									                                    <version>${sos.js7.version}</version>
									<packaging>jar</packaging>
									                                    <packaging>jar</packaging>
                                    <localRepositoryPath>${sos.js7.local.repodir}</localRepositoryPath>
									<createChecksum>true</createChecksum>
								</configuration>
							</execution>

						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					                                    <createChecksum>true</createChecksum>
                                </configuration>
                            </execution>
 
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
 
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
					                    <version>3.10.1</version>
					<configuration>
						version>
                    <configuration>
                        <source>1.8</source>
						                        <target>1.8</target>
						<optimize>true</optimize>
						<showDeprecation>true</showDeprecation>
						<showWarnings>true</showWarnings>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	                        <optimize>true</optimize>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>


Creating a JUnit Test for a JS7 Java job

...