need a little bit of help with Maven and SoapUI. The long-term plan is to integrate my SoapUI tests with Jenkins, however, i'm unfortunately falling down at the first hurdle, when getting my tests to run with Maven. Whenever I run my SoapUI tests via maven on the command line I keep getting the following error:
2017-09-20 10:03:06,977 ERROR [errorlog]
java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver
java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver at
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:264) at
groovy.sql.Sql.loadDriver(Sql.java:701) at
groovy.sql.Sql.newInstance(Sql.java:483) at
groovy.sql.Sql$newInstance.call(Unknown Source) at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at Script1.run(Script1.groovy:13) at
com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:100)
at
com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:154)
at
com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at
com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:52)
at
com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:152)
at
com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:47)
at
com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Now, As far as I'm aware I have included all the necessary dependencies. Here is a copy of my pom file. It's a simple one, I've borrowed from the internet and tweaked the usual bit.
<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.smartbear.samples</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 SoapUI Sample</name>
<url>http://maven.apache.org</url>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.0.0</version>
<configuration>
<outputFolder>logs</outputFolder>
<printReport>true</printReport>
<junitReport>true</junitReport>
<projectFile>test-testing-test-Service-API-soapui-project.xml</projectFile>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.31</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Can anybody spot any obvious mistakes I've made? have I missed something? Is there some setup/configuration I'm not aware of within Maven/SoapUI?
he searches for sqlserver dependency
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>{version}</version>
</dependency>
but mysql dependancy found in pom file
Related
I am integrating Soapui with jenkins using soapui version 5.3.0.
I am using correct plugins, and created a job on Jenkins, when running job on jenkins getting below error
ERROR: Processing failed due to a bug in the code. Please report this to the issue tracker (https://jenkins.io/redirect/report-an-issue).
java.lang.NullPointerException
project=hudson.maven.MavenModuleSet#1844c02b[Integration-/Feature/Dev/API/Testing1]
project.getModules()=[hudson.maven.MavenModule#2e2290bb[Integration-/Feature/Dev/API /Testing1/Test:gorun-Beakon][Integration-/Feature/Dev/API/Testing1/Test:gorun][relativePath:], hudson.maven.MavenModule#427c50e9[Integration-/Feature/Dev/API/Testing1/Test:Test][Integration-/Feature/Dev/API/Testing1/Test:Test][relativePath:], hudson.maven.MavenModule#73de5944[relativePath:], hudson.maven.MavenModule#1c7bb084[Integration-/Feature/Dev/API/Testing1/com.smartbear.soapui:soapui-project][Integration-/Feature/Dev/API/Testing1/com.smartbear.soapui:soapui-project][relativePath:], hudson.maven.MavenModule#71ee9349[Integration-/Feature/Dev/API/Testing1/tdrury:com.example.soapuitests][Integration-/Feature/Dev/API/Testing1/tdrury:com.example.soapuitests][relativePath:]]
project.getRootModule()=hudson.maven.MavenModule#2e2290bb[Integration-/Feature/Dev/API/Testing1/Test:gorun][Integration-/Feature/Dev/API/Testing1/Test:gorun][relativePath:]
FATAL: null
java.lang.NullPointerException
Posting build status of FAILED to SWC Bitbucket for commit id [30fd540296aa2f090025d21cf11eef35e13e9f5d] and ref 'refs/heads/master'
Failed to post build status, additional information: timeout
Finished: FAILURE
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.smartbear.samples</groupId>
<artifactId>soapui-maven2-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 SoapUI Sample</name>
<url>http://maven.apache.org</url>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-pro-maven-plugin</artifactId>
<version>5.3.0</version>
<dependencies>
</dependencies>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>gorun.xml</projectFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I am tried changing my pom and other properties but not sure why i am hitting this error.
This issue was coming because few dependencies were missing and maven was not complaining explicitly. So when run as normal maven project, got all missing dependencies and added them resolved this issue.
Thanks!!!
I've been having some difficulties setting up my SoapUI test in Gitlab pipeline. At first I was successful getting them to run in principle. By now I've added my real tests into the project and got into some problems with JDBC steps. I have both Oracle and Postgres connections in my steps. Can some of you tell me what I'm doing wrong?
At first I was getting connection errors left and right. Then I realized I probably need to add dependencies. I added
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.8</version>
</dependency>
but nothing changed. I also added oracle driver but now I'm getting
[ERROR] Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:5.5.0:test (default) on project dsa-otsusetugi-soapui-tests: Execution default of goal com.smartbear.soapui:soapui-maven-plugin:5.5.0:test failed: Plugin com.smartbear.soapui:soapui-maven-plugin:5.5.0 or one of its dependencies could not be resolved: Failed to collect dependencies at com.smartbear.soapui:soapui-maven-plugin:jar:5.5.0 -> com.oracle:ojdbc8:jar:12.2.0.1.0: Failed to read artifact descriptor for com.oracle:ojdbc8:jar:12.2.0.1.0: Could not transfer artifact com.oracle:ojdbc8:pom:12.2.0.1.0 from/to rmv_repo (http://repo.rmv/nexus/repository/maven-public/): Transfer failed for http://repo.rmv/nexus/repository/maven-public/com/oracle/ojdbc8/12.2.0.1.0/ojdbc8-12.2.0.1.0.pom: Unknown host repo.rmv: Name or service not known -> [Help 1]
What's interesting that I don't get any errors during the download phase..
https://pastebin.com/1HGXytJk
Currently my pom file containing dependencies looks like this:
<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>blaa.blaah</groupId>
<artifactId>blaa-blaah</artifactId>
<version>1.0-SNAPSHOT</version>
<name>BLAAHSoapUITests</name>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.version>3.0.0</maven.version>
<soapui.version>5.5.0</soapui.version>
<surefire.version>2.20</surefire.version>
</properties>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://smartbearsoftware.com/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.basedir}/test.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>${soapui.version}</version>
<configuration>
<soapuiProperties>
<property>
<name>soapui.logroot</name>
<value>${project.basedir}/build-testlog/build-testlog-</value>
</property>
</soapuiProperties>
<projectFile>${project.basedir}/${projectfile}</projectFile>
<projectProperties>
<value>END_POINT=${END_POINT}</value>
<value>USER_ID=${USER_ID}</value>
</projectProperties>
<outputFolder>${project.basedir}/build-testlog</outputFolder>
<printReport>true</printReport>
<junitReport>true</junitReport>
</configuration>
<dependencies>
<dependency>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui</artifactId>
<version>${soapui.version}</version>
<exclusions>
<exclusion>
<groupId>javafx</groupId>
<artifactId>jfxrt</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.8</version>
</dependency>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>forms</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<outputDirectory>${project.basedir}/build/reports/html</outputDirectory>
</reporting>
Am I doing something wrong? Am I using wrong dependencies?
Thanks in advance.
If anyone is facing something similar then my problem, as it turned out, was that Gitlab runner didn't have permission to access the postgres database. It did get the driver, but couldn't connect due to security settings.
Anyhow I still had problems with oracle driver, since it's not publically in smartbear repo. What I did is that I added the driver locally with the help of this tutorial: https://gist.github.com/timmolderez/92bea7cc90201cd3273a07cf21d119eb
So in the end my pom looked something like this:
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>https://rapi.tools.ops.smartbear.io/nexus/content/groups/public/</url>
</pluginRepository>
<pluginRepository>
<id>in-project</id>
<name>In Project Repo</name>
<url>file://${project.basedir}/lib</url>
</pluginRepository>
</pluginRepositories>
and
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>6.0</version>
</dependency>
groupId, artifactId and version (also folder names and jar, pom files, of course) named like the tutorial said.
My pom file:
<?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>pl.xx</groupId>
<artifactId>kwestionariusz</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.1.Final</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1201-jdbc41</version>
</dependency>
<dependency>
<groupId>unknown.binary</groupId>
<artifactId>postgresql-9.2-1002.jdbc4</artifactId>
<version>SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>pl.xx.kwestionariusz.gui.Kwestionariusz</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>unknown-jars-temp-repo</id>
<name>A temporary repository created by NetBeans for libraries and jars it could not identify. Please replace the dependencies in this repository with correct ones and delete this repository.</name>
<url>file:${project.basedir}/lib</url>
</repository>
</repositories>
</project>
error that I am getting when I try to run it via cmd:
\NetBeansProjects\kwestionariusz\target>java -jar kwestionariusz-1.0.jar
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/hiber
nate/service/ServiceRegistry
at pl.xx.kwestionariusz.dao.ListaZainteresowanDao.wyszukajZaintereso
wania(ListaZainteresowanDao.java:31)
at pl.xx.kwestionariusz.gui.Kwestionariusz$2.<init>(Kwestionariusz.j
ava:110)
at pl.xx.kwestionariusz.gui.Kwestionariusz.initComponents(Kwestionar
iusz.java:106)
at pl.xx.kwestionariusz.gui.Kwestionariusz.<init>(Kwestionariusz.jav
a:33)
at pl.xx.kwestionariusz.gui.Kwestionariusz$5.run(Kwestionariusz.java
:275)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.hibernate.service.ServiceRegist
ry
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 19 more
What do I have to add to pom file to make this project executable? It works when I compile and run it in netbeans but doesnt work when I try to use jar file.
#edit
still no solution
#edit
im starting bounty..
Your problem is the classpath. What you specify in .pom file are only the dependencies needed to build the project. However actually running the resulting .jar is another matter, and .pom has no power there.
It works in NetBeans IDE, because as any good IDE it keeps track of dependencies you added to the project and adds them to classpath when trying to run. Your cmd command does not replicate that.
There are two solutions to this problem:
Adding everything required to classpath. That would probably involve creating a .bat file containing the path to every required library using -cp argument
Creating your .jar file so that it contains all the required dependencies.
Solution number two sounds much better in theory, and can be achieved in Maven with (for example) OneJar or Maven Shade Plugin
Configuration of Maven Shade Plugin from one of my projects:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>my.package.tree.Main</Main-Class>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<!-- Exclude files that sign a jar (one or multiple of the dependencies).
One may not repack a signed jar without this, or you will get a SecurityException
at program start. -->
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.INF</exclude> <!-- This one may not be required -->
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
Add this to the dependency list in your POM:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.0.1.Final</version>
</dependency>
It seems that your NetBeans IDE somehow already has this JAR in its classpath, which likely means that you already have this JAR somewhere on your computer.
I ran into an error trying to test a WS using soapui maven plugin :
15:06:45,391 ERROR [AbstractTestRunner] Exception during Test Execution
java.lang.NoClassDefFoundError: javax/jms/JMSException
at com.eviware.soapui.impl.wsdl.submit.RequestTransportRegistry.<clinit>(RequestTransportRegistry.java:47)
at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:240)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:419)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:52)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:152)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: javax.jms.JMSException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 13 more
My pom is like the exemple on soapui website.
I'm trying to just run a simple test on my WS :
<pluginRepositories>
<pluginRepository>
<id>smartbear-sweden-plugin-repository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<properties>
<soapui.version>5.0.0</soapui.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>${soapui.version}</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>test-soapui-project.xml</projectFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
I tryed to add dependencies to jms in the the plugin and/or out the plugin.
Where this come from ?
Anyone got this error too ?
What am I missing ?
The proble is that JMS jar isn't present on maven central repo : http://mvnrepository.com/artifact/javax.jms/jms/1.1 try to download it you will get a 404.
Thanks to this answer : java.net maven repo - JMS artifact missing
I found it here : https://repository.jboss.org/nexus/content/groups/public/javax/jms/jms/1.1/ thanks JBoss.
I have a Maven project which is a part of a large scale enterprise system. I have not developed this project, but I have developed a small framework, which I am supposed to test, integrated with it. Upon copying, building and installing the project, it compiled, and I was able to launch it. However, after trying to add my framework (parent pom + 3 modules), I may have changed some settings, and now I am having trouble building the project. I have spent a lot of time trying to break down the problem, but all I have been able to do, is produce different errors, that I understand even less of.
I can't seem to find out where I can tell maven where to look for the parent POM. I have tried both the pom.xml, and settings.xml, but I haven't found any good options. I have also tried to change less obvious parameters, like changing localRepository, or adding repositories, but they proved ineffective
Here is my error message, interlaced with my attempts to fix it:
C:\development\my-main\customer-webpart>mvn install -Dmaven.test.skip=true
This is my domain. this includes the master pom of this project, although it is still part of a bigger system, and not the root. I would like to build, install and run this project, to test my framework. My framework is added as a dependency in the pom.xml.
[INFO] Scanning for projects...
Downloading: http://my-server:8080/archiva/repository/my-repository//
org/myportal/client-product/0.0/client-product-0.0.pom
I do not know where this archiva repository is defined. It is not in the pom.xml, or settings.xml. It seems to have an error with the double /, but the client-product-0.0.pom should not be retrieved from here anyway. It is located at C:/mavenLocalRepository/my-main/client-product/0.0/client-product-0.0.pom
Downloading: http://repo1.maven.org/maven2/org/myportal/
client-product/0.0/client-product-0.0.pom
This was also the wrong location to look for the .pom-file... so then the rest of the error is produced:
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:customer-webpart:zip:${org.myportal.version}
Reason: Cannot find parent: org.myportal:client-product for project: null:customer-webpart:zip:${org.myportal.version} for project null:customer-webpart:zip:${org.myportal.version}
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.myportal:client-product for project: null:customer-webpart:zip:${org.myportal.version} for project null:customer-webpart:zip:${org.myportal.version}
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.myportal:client-product for
project: null:customer-webpart:zip:${org.myportal.version} for project null:customer-webpart:zip:${org.myportal.version}
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1370)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:821)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.ja
va:506)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:198)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.myportal:client-product' not found in repository: Unable to download the artifact from any repository
org.myportal:client-product:pom:0.0
from the specified remote repositories:
my-repository (http://my-server:8080/archiva/repository/my-repository/),
localRepository2 (C:/mavenLocalRepository/logging-framework/),
localRepository (C:/mavenLocalRepository/my-main/),
central (http://repo1.maven.org/maven2)
for project org.myportal:client-product
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:6
03)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1366)
... 17 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
org.myportal:client-product:pom:0.0
from the specified remote repositories:
my-repository (http://my-server:8080/archiva/repository/my-repository/),
localRepository2 (C:/mavenLocalRepository/logging-framework/),
localRepository (C:/mavenLocalRepository/my-main/),
central (http://repo1.maven.org/maven2)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:74)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:5
56)
... 18 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:331)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:200)
... 20 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Oct 28 11:15:40 CET 2014
[INFO] Final Memory: 4M/61M
[INFO] ------------------------------------------------------------------------
C:\development\my-main\customer-webpart>
Also, this Eclipse-warning is given on my parent-tag of pom.xml for the project:
Project build error: Non-resolvable parent POM: Failure to transfer org.myportal:client-product:pom:0.0 from http://my-server:8080/archiva/repository/my-repository/ was cached in the local repository, resolution will not be reattempted until the update
interval of my-repository has elapsed or updates are forced. Original error: Could not transfer artifact org.myportal:client-product:pom:0.0 from/to my-repository (http://my-server:8080/archiva/repository/my-repository/): Failed to transfer http://my-server:8080/archiva/repository/my-repository/org/myportal/client-product/0.0/client-product-0.0.pom. Error code 307, Temporarily Moved for Domain Name Expansion and 'parent.relativePath' points at wrong local POM
...and I have tried three different approaches to the parent.relativePath. 1. None at all (no tag present), 2. Empty tag (suggested at another post here) 3. tag with full path of the .pom file.
POM.XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<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>org.myportal</groupId>
<artifactId>client-product</artifactId>
<version>0.0</version>
<relativePath>C:\mavenLocalRepository\my-main\org\myportal\client-product\0.0\client-product-0.0.pom</relativePath>
</parent>
<artifactId>my-webpart</artifactId>
<version>${org.myportal.version}</version>
<name>my-webpart</name>
<packaging>zip</packaging>
<description>
customer webpart
</description>
<properties>
<maven.test.skip>true</maven.test.skip>
<org.logging.framework.version>0.0.1-SNAPSHOT</org.logging.framework.version>
</properties>
<build>
<sourceDirectory>src/java</sourceDirectory>
<resources>
<resource>
<directory>src/java</directory>
</resource>
</resources>
<testSourceDirectory>src/test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>unzip-plugin</artifactId>
<version>${org.unzip.plugin.version}</version>
<executions>
<execution>
<id>unpack</id>
<goals>
<goal>unzip</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<resources>
<resource>
<groupId>org.workflow</groupId>
<artifactId>workflow-framework</artifactId>
<version>${org.myportal.version}</version>
<type>jar</type>
<includes>
<include>*.pdpart</include>
</includes>
<target>src/java/generated/common-pdparts</target>
</resource>
<resource>
<groupId>org.myportal</groupId>
<artifactId>myportal-portletframework</artifactId>
<version>${org.myportal.version}</version>
<type>jar</type>
<includes>
<include>*.pdpart</include>
</includes>
<target>src/java/generated/common-pdparts</target>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>descriptorloader-plugin</artifactId>
<version>${org.descriptorloader.plugin.version2}</version>
<executions>
<execution>
<id>vdoclet-java-clean</id>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<source>src/java</source>
<target>src/java</target>
</configuration>
</execution>
<execution>
<id>vdoclet-java</id>
<goals>
<goal>vdoclet</goal>
</goals>
<configuration>
<source>src/java</source>
<target>src/java</target>
<template>portletdescriptor/Control.vm</template>
<report>target/java-conversion.txt</report>
</configuration>
</execution>
<execution>
<id>vdoclet-jsp-clean</id>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<source>src/java</source>
<target>src/webapp</target>
</configuration>
</execution>
<execution>
<id>vdoclet-jsp</id>
<goals>
<goal>vdoclet</goal>
</goals>
<configuration>
<source>src/java</source>
<target>src/webapp</target>
<template>portletdescriptor/JspControl.vm</template>
<report>target/jsp-conversion.txt</report>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.main</groupId>
<artifactId>main-build-dependencies</artifactId>
<version>${org.main.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>zip-plugin</artifactId>
<version>${org.zip.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<fileSets>
<fileSet>
<directory>src/webapp</directory>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>WEB-INF/classes/</outputDirectory>
</fileSet>
</fileSets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<!-- Clean generated diretory -->
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>src/java</directory>
<includes>
<include>**/generated/**</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>my-client</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>my-portletdomain</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>effect-client</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>mycase-client</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>mycase-portletdomain</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<!-- myportal -->
<dependency>
<groupId>org.myportal</groupId>
<artifactId>mysecondportal-common</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>mysecondportal-webpartcommon</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>host-types</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.workflow</groupId>
<artifactId>workflow-framework</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${library.commons.fileupload.version}</version>
</dependency>
<!-- external -->
<dependency>
<groupId>faceless</groupId>
<artifactId>bfopdf</artifactId>
<version>0.0</version>
</dependency>
<!-- main -->
<dependency>
<groupId>org.main</groupId>
<artifactId>main-assemble-ear</artifactId>
<type>pom</type>
<version>${org.main.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>my-webdelegate</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myportal</groupId>
<artifactId>myportal-portletframework</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.myshare</groupId>
<artifactId>myshare-common</artifactId>
<version>${org.myshare.version}</version>
</dependency>
<dependency>
<groupId>org.myshare</groupId>
<artifactId>myshare-webpartcommon</artifactId>
<version>${org.myshare.version}</version>
</dependency>
<dependency>
<groupId>org.docflow</groupId>
<artifactId>docflow-client</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.docflow</groupId>
<artifactId>docflow-webdao</artifactId>
<version>${org.myportal.version}</version>
</dependency>
<dependency>
<groupId>org.esb.logging</groupId>
<artifactId>logging-framework</artifactId>
<version>${org.logging.framework.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>localRepository</id>
<url>C:/mavenLocalRepository/my-main/</url>
</repository>
<repository>
<id>localRepository2</id>
<url>C:/mavenLocalRepository/logging-framework/</url>
</repository>
</repositories>
</project>
parent (client-product-0.0.pom):
<?xml version="1.0" encoding="ISO-8859-1"?>
<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>org.product</groupId>
<artifactId>my-version-pom</artifactId>
<version>0.0</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.product</groupId>
<artifactId>my-product</artifactId>
<packaging>pom</packaging>
<version>0.0</version>
<name>my-product ${project.version} (old root-pom, now child of ${parent.artifactId})</name>
<modules>
<module>my-foundation-pom</module>
<module>pb-product-pom</module>
</modules>
<properties>
<!-- NISX: These properties should never be changed. Only change the value of org.component.version. -->
<org.assemble.my.version>${org.component.version.with.build.number}</org.assemble.my.version>
<org.myportal.version>${org.component.version}</org.myportal.version>
<org.myshare.version>${org.component.version}</org.myshare.version>
... + several others. shortened for stackoverflow
</properties>
<build>
<plugins>
<plugin>
<!-- NISX: This is a trick to avoid the ghost pom to be ever deployed to a repository. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
<inherited>false</inherited>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>qdev-maven-plugin</artifactId>
<version>${org.qdev.plugin.version}</version>
<inherited>true</inherited>
<configuration>
<beaDeployDirectory>${qdev.deploy.dir}</beaDeployDirectory>
<earName>${qdev.ear.name}</earName>
<warName>${qdev.war.name}</warName>
<isSingleWar>true</isSingleWar>
</configuration>
</plugin>
<plugin>
<groupId>org.maven.plugins</groupId>
<artifactId>maven-udv-plugin</artifactId>
<version>1.1.2</version>
<configuration>
<settingsApplicationName>my</settingsApplicationName>
<settingsApplicationVersion>${my.branch.name}</settingsApplicationVersion>
<settingsApplicationState>${profile.state}</settingsApplicationState>
</configuration>
</plugin>
</plugins>
</build>
</project>