When I changed jdk in my project from 8 to 11 I have cought this problem:
Connected to the target VM, address: '127.0.0.1:58645', transport: 'socket'
Error: JavaFX runtime components are missing, and are required to run this application
Disconnected from the target VM, address: '127.0.0.1:58645', transport: 'socket'
Process finished with exit code 1
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com</groupId>
<artifactId>desktop-client</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
</properties>
<build>
<outputDirectory>build</outputDirectory>
<finalName>Terminal</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>version.txt</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>font/*.ttf</include>
<include>fxml/**/*.fxml</include>
<include>images/**/*.png</include>
<include>images/**/*.jpg</include>
<include>images/**/*.svg</include>
<include>sound/*.wav</include>
<include>style/**/*.css</include>
<include>bundle/*.properties</include>
<include>testdata/*.*</include>
<include>com/**/*</include>
<include>welcome/**/*</include>
</includes>
<excludes>
<exclude>version.txt</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<mainClass>com.desktop.terminal.App</mainClass>
<classpathPrefix>lib/</classpathPrefix>
<useUniqueVersions>false</useUniqueVersions>
</manifest>
<manifestEntries>
<Class-Path>lib/ribbon-1.0.jar lib/controlsfx-8.40.14.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>ribbon</groupId>
<artifactId>ribbon</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/static/lib/ribbon-1.0.jar</systemPath>
</dependency>
<!-- https://mvnrepository.com/artifact/org.controlsfx/controlsfx -->
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>8.40.14</version>
<scope>system</scope>
<systemPath>${project.basedir}/static/lib/controlsfx-8.40.14.jar</systemPath>
</dependency>
<dependency>
<groupId>de.codecentric.centerdevice</groupId>
<artifactId>javafxsvg</artifactId>
<version>1.2.1</version>
</dependency>
<!-- JFREECHART -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart-fx</artifactId>
<version>1.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.10</version>
</dependency>
<!-- external API dependencies -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>LATEST</version>
</dependency>
<!-- client maven -->
<!--
<dependency>
<groupId>ru.novsys</groupId>
<artifactId>lib_uni-analysis</artifactId>
<version>LATEST</version>
</dependency>
-->
<dependency>
<groupId>org.bouncycastle.bcprov-jdk15on.1.57.org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.57</version>
</dependency>
<dependency>
<groupId>org.bouncycastle.bcprov-ext-jdk15on.1.57.org.bouncycastle</groupId>
<artifactId>bcprov-ext-jdk15on</artifactId>
<version>1.57</version>
</dependency>
<dependency>
<groupId>org.bouncycastle.bcpkix-jdk15on.1.57.org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.57</version>
</dependency>
<dependency>
<groupId>org.bouncycastle.bcmail-jdk15on.1.57.org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<version>1.57</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sourceforge-igetdb</id>
<name>igetdb repository as joone source</name>
<url>http://igetdb.sourceforge.net/maven2-repository</url>
</repository>
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
How you can see I added javafx dependency, but application doesn't work.
Related
I am unable to run serenityBDD tests in parallel.
Project is with 3 modules with standard steps(test/java/steps) and feature files(test/java/resources/feature_files) locations for api and ui modules. Everything works fine but with given pom file I am expecting tests to run parallel at feature files level but tests are being executed serially. I have referred this blog any help please?
api
common
ui
main pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>demo-automation</artifactId>
<description>demo-automation</description>
<groupId>demo-automation</groupId>
<name>demo-automation</name>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>common</module>
<module>api</module>
<module>ui</module>
</modules>
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<relativePath/>
<version>2.7.5</version> <!-- lookup parent from repository -->
</parent>
<properties>
<encoding>UTF-8</encoding>
<java.version>1.8</java.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<junit.vintage.version>5.8.2</junit.vintage.version>
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.failsafe.plugin.version>3.0.0-M5</maven.failsafe.plugin.version>
<maven.surefire.plugin.version>3.0.0-M5</maven.surefire.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<rest.version>4.2.1</rest.version>
<selenium.version>4.1.1</selenium.version>
<serenity.cucumber.version>3.2.3</serenity.cucumber.version>
<serenity.version>3.2.3</serenity.version>
<tags/>
<version>${project.version}</version>
</properties>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>bintray-plugins</name>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://jcenter.bintray.com</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<name>bintray</name>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://jcenter.bintray.com</url>
</repository>
<repository>
<id>maven_central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<version>${maven.surefire.plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/TestRunner*.java</include>
</includes>
<systemPropertyVariables>
<tags/>
<webdriver.base.url/>
</systemPropertyVariables>
<parallel>methods</parallel>
<threadCount>4</threadCount>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<version>${maven.failsafe.plugin.version}</version>
</plugin>
<plugin>
<artifactId>serenity-maven-plugin</artifactId>
<configuration>
<reports>single-page-html</reports>
<tags>${tags}</tags>
</configuration>
<dependencies>
<dependency>
<artifactId>serenity-single-page-report</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>${serenity.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>aggregate</goal>
</goals>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
</execution>
</executions>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<version>${serenity.version}</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<artifactId>spring-boot-starter</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>lombok</artifactId>
<groupId>org.projectlombok</groupId>
<optional>true</optional>
</dependency>
<!-- JUnit 5 -->
<dependency>
<artifactId>junit-jupiter-engine</artifactId>
<groupId>org.junit.jupiter</groupId>
<scope>test</scope>
<version>${junit.jupiter.version}</version>
</dependency>
<dependency>
<artifactId>junit-vintage-engine</artifactId>
<groupId>org.junit.vintage</groupId>
<scope>test</scope>
<version>${junit.vintage.version}</version>
</dependency>
<!-- Serenity -->
<dependency>
<artifactId>serenity-core</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>serenity-cucumber</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.cucumber.version}</version>
</dependency>
<dependency>
<artifactId>serenity-junit</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>maven-failsafe-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<type>maven-plugin</type>
<version>3.0.0-M5</version>
</dependency>
<dependency>
<artifactId>commons-lang3</artifactId>
<groupId>org.apache.commons</groupId>
</dependency>
<dependency>
<artifactId>jackson-databind</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</dependency>
<dependency>
<artifactId>spring-retry</artifactId>
<groupId>org.springframework.retry</groupId>
<scope>test</scope>
<version>1.2.5.RELEASE</version>
</dependency>
<dependency>
<artifactId>serenity-spring</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>3.5.0</version>
</dependency>
<dependency>
<artifactId>spring-boot-test</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<artifactId>httpcore</artifactId>
<groupId>org.apache.httpcomponents</groupId>
<scope>test</scope>
<version>4.4.15</version>
</dependency>
<dependency>
<artifactId>serenity-rest-assured</artifactId>
<exclusions>
<exclusion>
<artifactId>rest-assured</artifactId>
<groupId>io.rest-assured</groupId>
</exclusion>
</exclusions>
<groupId>net.serenity-bdd</groupId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>rest-assured</artifactId>
<groupId>io.rest-assured</groupId>
<version>${rest.version}</version>
</dependency>
<dependency>
<artifactId>xml-path</artifactId>
<groupId>io.rest-assured</groupId>
<version>${rest.version}</version>
</dependency>
<dependency>
<artifactId>json-path</artifactId>
<groupId>io.rest-assured</groupId>
<version>${rest.version}</version>
</dependency>
<dependency>
<artifactId>json-schema-validator</artifactId>
<groupId>io.rest-assured</groupId>
<version>${rest.version}</version>
</dependency>
<dependency>
<artifactId>cucumber-java</artifactId>
<groupId>io.cucumber</groupId>
<version>7.2.3</version>
</dependency>
<dependency>
<artifactId>spring-boot-starter-test</artifactId>
<exclusions>
<exclusion>
<artifactId>android-json</artifactId>
<groupId>com.vaadin.external.google</groupId>
</exclusion>
</exclusions>
<groupId>org.springframework.boot</groupId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>spring-rabbit</artifactId>
<groupId>org.springframework.amqp</groupId>
<version>2.4.2</version>
</dependency>
<dependency>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
<version>1.2.10</version>
</dependency>
<dependency>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
<version>2.11.0</version>
</dependency>
<dependency>
<artifactId>jackson-core</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<version>2.13.1</version>
</dependency>
<dependency>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<version>2.13.1</version>
</dependency>
<dependency>
<artifactId>assertj-core</artifactId>
<groupId>org.assertj</groupId>
<scope>test</scope>
<version>3.22.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
<dependency>
<artifactId>commons-cli</artifactId>
<groupId>commons-cli</groupId>
<version>1.5.0</version>
</dependency>
</dependencies>
</project>
And ui pox.xml,
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>ui</name>
<artifactId>ui</artifactId>
<parent>
<artifactId>demo-automation</artifactId>
<groupId>demo-automation</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.19.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<configuration>
<sourceDirectory>${basedir}/src/test/resources/schema</sourceDirectory>
<sourceType>json</sourceType>
<targetPackage>demo.ui</targetPackage>
<useCommonsLang3>true</useCommonsLang3>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<groupId>org.jsonschema2pojo</groupId>
<version>0.4.34</version>
</plugin>
<plugin>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<configuration>
<sources>
<source>>${basedir}/target/java-gen</source>
</sources>
</configuration>
<goals>
<goal>add-source</goal>
</goals>
<id>test</id>
<phase>generate-sources</phase>
</execution>
</executions>
<groupId>org.codehaus.mojo</groupId>
<version>1.4</version>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<artifactId>common</artifactId>
<groupId>demo-automation</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<artifactId>serenity-screenplay</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>serenity-screenplay-webdriver</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.version}</version>
</dependency>
<dependency>
<artifactId>serenity-ensure</artifactId>
<groupId>net.serenity-bdd</groupId>
<scope>test</scope>
<version>${serenity.version}</version>
</dependency>
</dependencies>
</project>
Looks like you are indirectly running Serenity through the junit-vintage-engine. When executed this way, parallel execution is simply not supported.
To be exact you are running your tests through Surefire -> JUnit 5 -> JUnit Vintage -> JUnit 4 -> Serenity -> Cucumber.
You'd have to wait for JUnit Vintage to support parallel execution or get rid of JUnit 5 from your depencies so Surefire can run JUnit 4 directly.
However given that you are also using Spring you may not be able to get rid of JUnit 5.
You could ask Serenity to support JUnit 5 but I suspect they will be unable too. They have never bothered to contribute the extension points they'd need upstream. Instead they have hacked their stuff into Cucumber.
I have a java web-service which i try to create the jar file by using eclipse. I create the jar file by inserting goal=package but the created jar file cannot star by using batch file. By the way, the project runs locally in eclipse and connects to the database. Does anyone know what I am missing while creating the jar file.
Here is my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.galaksiya</groupId>
<artifactId>SectraXDSIIntegration</artifactId>
<version>2.1.8</version>
<profiles>
<profile>
<id>production</id>
<build>
<resources>
<resource>
<directory>web/app</directory>
<includes>
<include>**/*</include>
</includes>
<targetPath>resources</targetPath>
</resource>
<resource>
<directory>src/main/resources/templates</directory>
<includes>
<include>**/*</include>
</includes>
<targetPath>templates</targetPath>
</resource>
<resource>
<directory>production</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
<mainClass>com.galaksiya.sectra.integration.main.Runner</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>web/app</directory>
<includes>
<include>**/*</include>
</includes>
<targetPath>resources</targetPath>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>www.dcm4che.org</id>
<name>dcm4che Repository</name>
<url>http://www.dcm4che.org/maven2</url>
</repository>
<repository>
<id>galaksiya</id>
<url>http://maven.galaksiya.net</url>
</repository>
<repository>
<id>gluu</id>
<name>Gluu repository</name>
<url>http://ox.gluu.org/maven</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.sun.media</groupId>
<artifactId>jai_imageio</artifactId>
<version>1.2-pre-dr-b04</version>
<scope>runtime</scope>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.dcm4che.tool</groupId> -->
<!-- <artifactId>dcm4che-tool-common</artifactId> -->
<!-- <version>3.3.7</version> -->
<!-- <scope>compile</scope> -->
<!-- </dependency> -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>com.galaksiya</groupId>
<artifactId>DatabaseConnector</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>com.galaksiya</groupId>
<artifactId>MakeKOS</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>com.galaksiya</groupId>
<artifactId>SendKOS</artifactId>
<version>1.5.5</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.2.3.v20140905</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.2.3.v20140905</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-client -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>9.2.3.v20140905</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>2.25</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-jetty</artifactId>
<version>2.25</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.4.jre8-preview</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.25</version>
</dependency>
<dependency>
<groupId>com.galaksiya</groupId>
<artifactId>GLogger</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>com.galaksiya</groupId>
<artifactId>Emailer</artifactId>
<version>1.0.3</version>
<exclusions>
<exclusion>
<groupId>com.galaksiya</groupId>
<artifactId>GLogger</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.galaksiya.sectra</groupId>
<artifactId>Middleware</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.galaksiya.sectra</groupId>
<artifactId>Middleware</artifactId>
<version>1.0-SNAPSHOT</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>dcm4che.tool</groupId>
<artifactId>dcm4che-tool-dcmsnd</artifactId>
<version>2.0.29</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
To create an executable jar file you need to add a <mainClass> element to the maven-jar-plugin manifest configuration. Your pom.xml already contains such a configuration, but it is placed within a profile called production. As such, it is ignored unless you activate the production profile:
mvn package -Pproduction
After this you should be able to start your jar file as follows:
java -jar target/SectraXDSIIntegration-2.1.8.jar
For more information about profiles you can check out the relevant Maven documentation, and for more information on how to configure the maven-jar-plugin you can check out its documentation.
Getting below error for the following POM. Code get build locally and executes fine.
But get below exception in Jenking build. Please suggest.
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-jar-plugin:3.1.1:jar (default-jar) on
project app-profile: Execution default-jar of goal
org.apache.maven.plugins:maven-jar-plugin:3.1.1:jar failed: Plugin
org.apache.maven.plugins:maven-jar-plugin:3.1.1 or one of its
dependencies could not be resolved: Failed to collect dependencies at
org.apache.maven.plugins:maven-jar-plugin:jar:3.1.1 ->
org.apache.maven:maven-archiver:jar:3.3.0: Failed to read artifact
descriptor for org.apache.maven:maven-archiver:jar:3.3.0: Could not
transfer artifact org.apache.maven:maven-archiver:pom:3.3.0 from/to
central (https://repo.maven.apache.org/maven2): Connection reset ->
[Help 1]
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>app-someApp</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
</parent>
<properties>
<docker.image.prefix>springio</docker.image.prefix>
<java.version>1.8</java.version>
<!--SonarQube properties -->
<sonar.projectName>test-app-someApp</sonar.projectName>
<sonar.projectVersion>1.0</sonar.projectVersion>
<sonar.scm.provider>git</sonar.scm.provider>
<sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
<sonar.jacoco.reportPaths>target/jacoco.exec</sonar.jacoco.reportPaths>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.0.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>someClass.class</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.3.6</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>com/generated/**/*</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.0.905</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Greenwich.SR6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.19</version>
</dependency>
<dependency>
<groupId>com.wsd.common.utilities</groupId>
<artifactId>wsd-java-common-utilities</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
<version>2.6.4</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.newrelic.agent.java</groupId>
<artifactId>newrelic-api</artifactId>
<version>5.13.0</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-new-relic</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<scope>test</scope>
</dependency>
<!-- JAXB Binders to suppress a bug in Spring Release 2.0.0; Consider removing
these as it may get fixed in newer Spring releases -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version><!--$NO-MVN-MAN-VER$ -->
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- JAXB Binders to suppress a bug in Spring Release 2.0.0; Consider removing
these as it may get fixed in newer Spring releases -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sqs</artifactId>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sns</artifactId>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-sqs-java-messaging-lib</artifactId>
<version>1.0.8</version>
</dependency>
<dependency>
<groupId>com.dlq.wsd.ntr.sharedlibrary</groupId>
<artifactId>ntr-web-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.dlq.wsd.ntr.sharedlibrary</groupId>
<artifactId>ntr-logmanager-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.4.5</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>llp-java-common-utilities</id>
<url>http://internal.com/artifactory/ntr-java-common-utilities</url>
</repository>
<repository><!-- Common utilities -->
<id>apps-release-local</id>
<url>http://internal.com/artifactory/apps-release-local</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>https://repo.spring.io/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>
Since Maven repo was unreachable many a times, reason could be any, network or porxy.
So DevOps team set up our own repo which we used to refer our dependencies.
it fixed the issue. Instead of maven repo we now use our Repo.
How can I add the reference library in to my zip file while building with maven.
I am trying to achieve it through assembly as suggested in some blogs. But it didn't working for me. Please help me if it can achieve through or there is other way around. Here is the below code I am trying.
Added this in my pom.xml
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxx</groupId>
<artifactId>cs-app</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>Mule cs-app Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<mule.version>3.6.1</mule.version>
<mule.tools.version>1.0</mule.tools.version>
<munit.version>3.6.0-BETA</munit.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-app-maven-plugin</artifactId>
<version>${mule.tools.version}</version>
<extensions>true</extensions>
<configuration>
<copyToAppsDirectory>true</copyToAppsDirectory>
<inclusions>
<inclusion>
<groupId>org.mule.modules</groupId>
<artifactId></artifactId>
</inclusion>
</inclusions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>project</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/app/</directory>
</resource>
<resource>
<directory>mappings/</directory>
</resource>
<resource>
<directory>src/main/api/</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
<!-- <testResources> <testResource> <directory>src/test/resources</directory>
</testResource> </testResources> -->
</build>
<!-- Mule Dependencies -->
<dependencies>
<!-- Xml configuration -->
<!-- Mule Transports -->
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-file</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-http</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-jdbc</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-jms</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency> -->
<!-- Mule Modules -->
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-scripting</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-xml</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.xml.xquery</groupId>
<artifactId>xqj-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Dependency added for mandrillapp -->
<dependency>
<groupId>com.mandrillapp.wrapper.lutung</groupId>
<artifactId>lutung</artifactId>
<version>0.0.5</version>
</dependency>
<!-- for testing -->
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-http</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-mongo</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-jersey</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-devkit-support</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-interceptor-module</artifactId>
<version>${munit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-core</artifactId>
<version>1.3.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>1.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
<!-- <scope>test</scope> -->
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-pro</artifactId>
<version>1.0.16</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-json</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-client</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
</dependency>
<!-- <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId>
<version>6.8.8</version> <scope>test</scope> </dependency> -->
<!-- Spring data mongodb
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>1.2.0.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>jcl-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency> -->
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-spring-config</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Central</id>
<name>Central</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-snapshots</id>
<name>MuleSoft Snapshots Repository</name>
<url>http://repository.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven 2</name>
<url>http://download.java.net/maven/2/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-release</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>http://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>mule-plugin</id>
<name>Mule Public Repository</name>
<url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
</pluginRepository>
</pluginRepositories>
My assembly.xml
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>jar-with-dependencies</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<outputDirectory>/</outputDirectory>
<directory>src/main/resources</directory>
<includes>
<include>mule-config.xml</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
<useTransitiveFiltering>true</useTransitiveFiltering>
<excludes>
<exclude>org.mule:mule-core</exclude>
<exclude>org.mule.transports:mule-transport-*</exclude>
<exclude>org.mule.modules:mule-module-*</exclude>
<exclude>org.springframework:spring-*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
Try after, removing <scope>provided</scope> from the <dependency> tag.
I have a directory structure like the following (following the suggestion here:
parent-dir
pom.xml
core-dir
|
------pom.xml
web-service-dir
|
------pom.xml
Here is my MAIN (parent-dir) pom:
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ca.ubc</groupId>
<artifactId>iamWebServices</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>${project.artifactId}</name>
<url>http://maven.apache.org</url>
<properties>
<project_home>${project.dir}</project_home>
</properties>
<modules>
<module>core</module>
<module>webService</module>
</modules>
<dependencyManagement>
<dependencies>
<!-- Inter-Module dependencies -->
<dependency>
<groupId>ca.ubc.iam.core</groupId>
<artifactId>iamCore</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
And here is my POM.XML:
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ca.ubc</groupId>
<artifactId>iamWebServices</artifactId>
<version>1.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>iamCore</artifactId>
<groupId>ca.ubc.iam.core</groupId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<version>1.0</version>
<properties>
<target.dir>target</target.dir>
</properties>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cryptix</groupId>
<artifactId>cryptix</artifactId>
<version>3.2.0</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>
<groupId>libmd5</groupId>
<artifactId>md5tools</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>libojdbc6</groupId>
<artifactId>ojdbc6</artifactId>
<version>1.0.0</version>
</dependency> -->
<dependency>
<groupId>local.jcrypt</groupId>
<artifactId>jcrypt</artifactId>
<scope>system</scope>
<version>xx</version>
<systemPath>${project.basedir}/src/lib/jcrypt.jar</systemPath>
</dependency>
<dependency>
<groupId>local.md5tools</groupId>
<artifactId>md5tools</artifactId>
<version>xx</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/lib/md5tools.jar</systemPath>
</dependency>
<dependency>
<groupId>local.randomPasswordGenerator</groupId>
<artifactId>randomPasswordGenerator</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/lib/RandomPasswordGenerator.jar</systemPath>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<!-- <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version> <scope>system</scope> <systemPath>${project.basedir}/src/lib/ojdbc6.jar</systemPath>
</dependency> -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
</dependencies>
<build>
<finalName>iamcore</finalName>
<outputDirectory>${basedir}/${target.dir}/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<!-- copy-dependency plugin -->
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</build>
</project>
and finally, here is my POM.XML:
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ca.ubc</groupId>
<artifactId>iamWebServices</artifactId>
<version>1.0</version>
<relativePath>..</relativePath>
</parent>
<groupId>ca.ubc.iamws</groupId>
<artifactId>iamws</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>${project.artifactId}</name>
<properties>
<jersey.version>2.5.1</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
<codi.version>1.0.5</codi.version>
<target.dir>target</target.dir>
</properties>
<repositories>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ca.ubc.iam.core</groupId>
<artifactId>iamCore</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope></scope>
</dependency>
<dependency>
<groupId>cryptix</groupId>
<artifactId>cryptix</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>local.jcrypt</groupId>
<artifactId>jcrypt</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jcrypt.jar</systemPath>
</dependency>
<dependency>
<groupId>local.md5tools</groupId>
<artifactId>md5tools</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/md5tools.jar</systemPath>
</dependency>
<dependency>
<groupId>local.randomPasswordGenerator</groupId>
<artifactId>randomPasswordGenerator</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/RandomPasswordGenerator.jar</systemPath>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>${jersey.version}</version>
</dependency>
<!-- jackson dependencies for pojo/json support -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
</dependency>
<!-- end jackson deps -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-processing</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<!-- junit test and jersey client features -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<!-- Weld/CDI Begin -->
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>2.1.2.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>iamws</finalName>
<outputDirectory>${basedir}/${target.dir}/classes</outputDirectory>
<testOutputDirectory>${basedir}/${target.dir}/test-classes</testOutputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<packagingExcludes>src/test/*</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<!-- copy-dependency plugin -->
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>eclipse-folders</id>
<properties>
<target.dir>target-eclipse</target.dir>
</properties>
</profile>
</profiles>
</project>
When I build from the parent-dir and issue a command-line like:
mvn install
I get an error that the jar file cannot be found. What am I doing wrong?
[ERROR] Failed to execute goal on project iamws: Could not resolve dependencies for project ca.ubc.iamws:iamws:war:1.0: Could not find artifact ca.ubc.iam.core:iamCore:jar:1.0 in jboss-public-repository-group (https://repository.jboss.org/nexus/content/repositories/releases/) -> [Help 1]
It looks like it's trying to download my locally built jar file from an external repository, and I can't figure out how to fix that?
First of all you seem to have different artifactId, than module names. Although not a problem, it makes things a little bit harder to look at :)
When you issue a mvn install it will attempt to resolve the the pom files first to generate some effective POM files for the project, and that means that before it builds any of your modules, the parent pom needs to be resolved.
In the parent you depend on the iamcore module, but you haven't built it yet, and that's the reason why it fails.
Remove the dependency from the parent, and just put it into iamwebservice