I have downloaded spring-plugin (https://github.com/spring-projects/spring-plugin). I have unpacked it and when trying to install it using maven (version 3.1.0) I am getting an error.
The original POM file is as follows:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin</artifactId>
<packaging>pom</packaging>
<name>Spring Plugin</name>
<version>1.1.0.BUILD-SNAPSHOT</version>
<description>Simple plugin infrastructure</description>
<organization>
<name>Pivotal, Inc.</name>
<url>http://www.springsource.org</url>
</organization>
<inceptionYear>2008</inceptionYear>
<url>https://github.com/SpringSource/spring-plugin</url>
<modules>
<module>core</module>
<module>metadata</module>
<module>integration</module>
</modules>
<properties>
<spring.version>3.2.7.RELEASE</spring.version>
<slf4j.version>1.7.5</slf4j.version>
</properties>
<developers>
<developer>
<id>gierke</id>
<name>Oliver Gierke</name>
<email>ogierke#gopivotal.com</email>
<url>http://www.olivergierke.de</url>
<organization>Pivtoal</organization>
<organizationUrl>http://www.gopivotal.com</organizationUrl>
<roles>
<role>Project lead</role>
</roles>
<timezone>+1</timezone>
</developer>
</developers>
<dependencies>
<!-- Common test dependencies -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.springsource.bundlor</groupId>
<artifactId>com.springsource.bundlor.maven</artifactId>
<version>1.0.0.RELEASE</version>
<executions>
<execution>
<id>bundlor</id>
<goals>
<goal>bundlor</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<failOnWarnings>true</failOnWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<useDefaultManifestFile>true</useDefaultManifestFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<scm>
<url>https://github.com/spring-projects/spring-plugin</url>
<connection>scm:git:git://github.com/spring-projects/spring-plugin.git</connection>
<developerConnection>scm:git:ssh://git#github.com:spring-projects/spring-plugin.git</developerConnection>
</scm>
<ciManagement>
<system>Bamboo</system>
<url>https://build.springsource.org/browse/PLUGIN-MASTER</url>
</ciManagement>
<issueManagement>
<system>Github</system>
<url>https://github.com/spring-projects/spring-plugin/issues</url>
</issueManagement>
<repositories>
<repository>
<id>spring-libs-release</id>
<url>http://repo.spring.io/libs-release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-plugins-release</id>
<url>http://repo.spring.io/plugins-release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
I am trying to install it using the following command line
c:\myPathToSpringPlugin> mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Spring Plugin
[INFO] Spring Plugin - Core
[INFO] Spring Plugin - Metadata Extension
[INFO] Spring Plugin - Spring Integration integration
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Plugin 1.1.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.spring.io/pluginsrelease/com/springsource/bundlor/com.springsource.bundlor.maven/1.0.0.RELEASE/com.springsource.bundlor.maven-1.0.0.RELEASE.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Spring Plugin ..................................... FAILURE [21.581s]
[INFO] Spring Plugin - Core .............................. SKIPPED
[INFO] Spring Plugin - Metadata Extension ................ SKIPPED
[INFO] Spring Plugin - Spring Integration integration .... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.704s
[INFO] Finished at: Mon Apr 28 19:13:03 CEST 2014
[INFO] Final Memory: 8M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE: Could not transfer artifact com.springsource.bundlor:com.springsource.bundlor.maven:pom:1.0.0.RELEASE from/to spring-plugins-release (http://repo.spring.io/plugins-release): Connection to (MY PROXY) refused: Connection timed out: connect -> [Help 1]
[ERROR]
But if I sent a request using a web browser to the url
http://repo.spring.io/pluginsrelease/com/springsource/bundlor/com.springsource.bundlor.maven/1.0.0.RELEASE/com.springsource.bundlor.maven-1.0.0.RELEASE.pom
I am getting the POM file.
What can I do in order to get the spring-plugin up and running?
The fact that you see the pom, does not mean nothing...!
Reading the log, i think it's a simple connection error, the log say "connection refused by the proxy"... so maybe you have a proxy and have not configured (or maybe not configured in a correct way) the proxy setting inside the setting.xml..
Can you paste your setting.xml file....?
I tried downloading and building and it's working:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Spring Plugin ..................................... SUCCESS [ 30.553 s]
[INFO] Spring Plugin - Core .............................. SUCCESS [ 9.290 s]
[INFO] Spring Plugin - Metadata Extension ................ SUCCESS [ 1.844 s]
[INFO] Spring Plugin - Spring Integration integration .... SUCCESS [ 9.929 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.837 s
[INFO] Finished at: 2014-04-29T00:52:23+07:00
[INFO] Final Memory: 22M/104M
[INFO] ------------------------------------------------------------------------
From your maven error:
from/to spring-plugins-release (http://repo.spring.io/plugins-release): Connection to (MY PROXY) refused: Connection timed out: connect -> [Help 1]
I think you're having a problem with the proxy!
Related
I've got a weird one. I'm running a series of Java tests via Maven locally using the command line successfully:
LeveneS#WS3748 MINGW64 /h/Coding/workspace/[MY-PROJECT] (initalCommit)
$ mvn surefire-report:report test site
[INFO] Scanning for projects...
[INFO]
[INFO] ---< [MY-PROJECT] >----
[INFO] Building [MY-PROJECT] 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ...etc...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.example.ExampleTest
40 Scenarios (40 passed)
91 Steps (91 passed)
0m0.322s
[INFO] Tests run: 131, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.01 s - in com.example.ExampleTest
I want to run this in Jenkins using multi-branch pipeline; so I've created a Jenkinsfile as such:
pipeline {
agent { docker { image 'maven:3.6.1' } }
stages {
stage('Installation') {
steps {
sh 'mvn --version'
sh 'mvn install'
}
}
stage('Run') {
steps {
sh 'mvn surefire-report:report test site'
}
}
}
}
However, when I run this in Jenkins, I get the following error:
+ mvn surefire-report:report test site
[INFO] Scanning for projects...
[INFO]
[INFO] ---< [MY-PROJECT] >----
[INFO] Building [MY-PROJECT] 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ...etc...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.example.ExampleTest
No features found at [classpath:com/example]
0 Scenarios
0 Steps
0m0.000s
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.442 s - in com.example.ExampleTest
It looks like it can't find my classpath... but it works locally, so I can't see why it would fail on Jenkins; in any case; here's my POM File:
<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>[MY-PROJECT]</groupId>
<artifactId>[MY-PROJECT]</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<classpathScope>test</classpathScope>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath />
<argument>cucumber.api.cli.Main</argument>
<argument>--plugin</argument>
<argument>json:${project.build.directory}/cuke-results.json</argument>
<argument>--glue</argument>
<argument>com.example</argument>
<argument>--strict</argument>
<argument>${basedir}/src/test/java/com/example</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
</dependencies>
</project>
With maven, I want to deploy this project locally with all the dependencies to the tomcat server. But I get some errors. I use the operating system archlinux and tomcat installed in the "/opt" directory.
Java version: "11.0.2" 2019-01-15 LTS
Maven version:3.0.6
Tomcat version:9.0.17
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>TomcatServer</id>
<username>onur</username>
<password>onur123</password>
</server>
</servers>
<profiles>
<profile>
<properties>
<tomcathome>/opt/apache-tomcat-9.0.17</tomcathome>
</properties>
<repositories>
<repository>
<id>DefaultRepo</id>
<url>http://localhost:8080/estech</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</profile>
</profiles>
</settings>
This is my pom.xml. I use maven deploy plugin for deploy to tomcat server. How can I fix this?
<?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.pmyo.group5</groupId>
<artifactId>estech</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<distributionManagement>
<repository>
<id>DefaultRepo</id>
<name>localhost</name>
<url>http://localhost:8080/estech/</url>
</repository>
</distributionManagement>
<name>estech Maven Webapp</name>
<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>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
<build>
<finalName>estech</finalName>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Error:
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.pmyo.group5:estech >-----------------------
[INFO] Building estech Maven Webapp 1.0
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # estech ---
[INFO] Deleting /home/onur/IdeaProjects/Es-tech/estech/target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) # estech ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/onur/IdeaProjects/Es-tech/estech/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) # estech ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /home/onur/IdeaProjects/Es-tech/estech/target/classes
[INFO] /home/onur/IdeaProjects/Es-tech/estech/src/main/java/Models/ProductComments.java: Some input files use or override a deprecated API.
[INFO] /home/onur/IdeaProjects/Es-tech/estech/src/main/java/Models/ProductComments.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) # estech ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/onur/IdeaProjects/Es-tech/estech/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) # estech ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) # estech ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:3.2.2:war (default-war) # estech ---
[INFO] Packaging webapp
[INFO] Assembling webapp [estech] in [/home/onur/IdeaProjects/Es-tech/estech/target/estech]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/onur/IdeaProjects/Es-tech/estech/src/main/webapp]
[INFO] Webapp assembled in [152 msecs]
[INFO] Building war: /home/onur/IdeaProjects/Es-tech/estech/target/estech.war
[INFO]
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-cli) # estech ---
Uploading to DefaultRepo: http://localhost:8080/estech/com/pmyo/group5/estech/1.0/estech-1.0.war
Uploading to DefaultRepo: http://localhost:8080/estech/com/pmyo/group5/estech/1.0/estech-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.847 s
[INFO] Finished at: 2019-05-02T19:48:25+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-cli) on project estech: Failed to deploy artifacts: Could not transfer artifact com.pmyo.group5:estech:war:1.0 from/to DefaultRepo (http://localhost:8080/estech/): Failed to transfer file http://localhost:8080/estech/com/pmyo/group5/estech/1.0/estech-1.0.war with status code 405 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
maven-deploy-plugin is not for deploying your WAR into Tomcat. It is used to transfer build artifacts into repository.
You should take a look at tomcat-maven-plugin or cargo-maven-plugin
I have integrated my jmeter script with maven. I have jmeter plugin manager also. While running it, i am getting java.lang.IllegalArgumentException which is resulting into above exception. I have added dependency for jmeter plugin manager and xstream but still i am getting same error.
exactly same kind of issue has been discussed here, but the content now has been removed.
https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/issues/194
pom file -
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>test_framework</groupId>
<artifactId>api_test_plan</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dkc_api_test_plan</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<ThreadCount.thread1>10</ThreadCount.thread1>
</properties>
<build>
<plugins>
<!-- jmeter plugin to run jmeter through maven build -->
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.7.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<resultsFileFormat>xml</resultsFileFormat>
<generateReports>false</generateReports>
<testResultsTimestamp>false</testResultsTimestamp>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins:pom:1.3.1</artifact>
</jmeterExtensions>
<!-- inputFile>${project.build.directory}/jmeter/results/CreateOrderLoadTest.jtl</inputFile -->
</configuration>
</plugin>
<!--surefire plugin to generate html reports -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<outputFolder>${project.build.directory}/target/surefire-reports</outputFolder>
<printReport>true</printReport>
<exportAll>true</exportAll>
</configuration>
</plugin>
<!-- plugin> <groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-analysis-maven-plugin</artifactId>
<version>1.0.4</version> <configuration> <source>${project.build.directory}/jmeter/results/dkc_sales.jtl</source>
</configuration> <executions> <execution> <id>create-html-report</id> <phase>verify</phase>
<goals> <goal>analyze</goal> </goals> </execution> </executions> </plugin -->
</plugins>
<!-- https://mvnrepository.com/artifact/junit/junit -->
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_java</artifactId>
<version>3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/kg.apc/jmeter-plugins-manager <dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-manager</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
</project> ```
-------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO]
[INFO] Executing test: myFile.jmx
[INFO] Starting process with:[java, -Xms512M, -Xmx512M, -jar, ApacheJMeter-4.0.jar, -d, D:\Projects\....
[INFO] Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'D:\Projects\\target\jmeter\testFiles\myFile.jmx', missing class com.thoughtworks.xstream.converters.ConversionException:
[INFO] ---- Debugging information ----
[INFO] cause-exception : com.thoughtworks.xstream.converters.ConversionException
[INFO] cause-message :
[INFO] first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
[INFO] class : org.apache.jmeter.save.ScriptWrapper
[INFO] required-type : org.apache.jorphan.collections.ListedHashTree
[INFO] converter-type : org.apache.jmeter.save.ScriptWrapperConverter
[INFO] path : /jmeterTestPlan/hashTree/hashTree/hashTree[3]/hashTree[5]/hashTree[4]/hashTree[3]/com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
[INFO] line number : 3610
[INFO] version : 4.0 r1823414
[INFO] -------------------------------
[INFO] Completed Test: D:\Projects\Project_Name\api_test_plan\target\jmeter\testFiles\myFile.jmx
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.003 s
[INFO] Finished at: 2019-04-19T12:53:28+05:30
[INFO] Final Memory: 38M/282M
[INFO] ------------------------------------------------------------------------
[INFO] Shutdown detected, destroying JMeter process...**strong text**
Don’t use pom dependencies as you did in:
kg.apc:jmeter-plugins:pom:1.3.1
It should work
Hello I'm trying to run mvn clean install, and I'm receiving a package does not exist error:
[DEBUG] Source roots:
[DEBUG] /Users/username/Projects/Venice/clarity/clarity-test-e2e/src/test/java
[DEBUG] Command line options:
[DEBUG] -d /Users/username/Projects/Venice/clarity/clarity-test-e2e/target/test-classes -classpath /Users/username/Projects/Venice/clarity/clarity-test-e2e/target/test-classes:/Users/username/Projects/Venice/clarity/clarity-test-e2e/target/classes:/Users/username/.m2/repository/uk/co/jemos/podam/podam/7.0.5.RELEASE/podam-7.0.5.RELEASE.jar:/Users/username/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar:/Users/username/.m2/repository/org/slf4j/slf4j-api/1.7.22/slf4j-api-1.7.22.jar:/Users/username/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar:/Users/username/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar:/Users/username/.m2/repository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar:/Users/username/.m2/repository/org/testng/testng/6.11/testng-6.11.jar:/Users/username/.m2/repository/com/beust/jcommander/1.64/jcommander-1.64.jar:/Users/username/.m2/repository/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar:/Users/username/Projects/Venice/clarity/clarity-etl/target/clarity-etl-1.0.0-SNAPSHOT.jar:/Users/username/Projects/Venice/clarity/clarity-statusserv/dao/target/clarity-statusserv-dao-1.0.0-SNAPSHOT.jar:/Users/username/Projects/Venice/clarity/clarity-statusserv/model/target/clarity-statusserv-model-1.0.0-SNAPSHOT.jar:/Users/username/.m2/repository/org/apache/commons/commons-collections4/4.1/commons-collections4-4.1.jar:/Users/username/.m2/repository/org/hibernate/hibernate-validator/5.4.1.Final/hibernate-validator-5.4.1.Final.jar:/Users/username/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar:/Users/username/.m2/repository/com/fasterxml/classmate/1.3.3/classmate-1.3.3.jar:/Users/username/.m2/repository/org/projectlombok/lombok/1.16.12/lombok-1.16.12.jar:/Users/username/.m2/repository/org/springframework/boot/spring-boot-starter/1.5.1.RELEASE/spring-boot-starter-1.5.1.RELEASE.jar:/Users/username/.m2/repository/org/springframework/boot/spring-boot/1.5.1.RELEASE/spring-boot-1.5.1.RELEASE.jar:/Users/username/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.5.1.RELEASE/spring-boot-autoconfigure-1.5.1.RELEASE.jar:/Users/username/.m2/repository/org/springframework/spring-core/4.3.6.RELEASE/spring-core-4.3.6.RELEASE.jar:/Users/username/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar:/Users/username/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar:/Users/username/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/username/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar:/Users/username/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/1.5.1.RELEASE/spring-boot-starter-log4j2-1.5.1.RELEASE.jar:/Users/username/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.7/log4j-slf4j-impl-2.7.jar:/Users/username/.m2/repository/org/apache/logging/log4j/log4j-api/2.7/log4j-api-2.7.jar:/Users/username/.m2/repository/org/apache/logging/log4j/log4j-core/2.7/log4j-core-2.7.jar:/Users/username/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.22/jcl-over-slf4j-1.7.22.jar:/Users/username/.m2/repository/org/slf4j/jul-to-slf4j/1.7.22/jul-to-slf4j-1.7.22.jar:/Users/username/.m2/repository/org/springframework/data/spring-data-couchbase/2.2.0.RELEASE/spring-data-couchbase-2.2.0.RELEASE.jar:/Users/username/.m2/repository/org/springframework/spring-context/4.3.6.RELEASE/spring-context-4.3.6.RELEASE.jar:/Users/username/.m2/repository/org/springframework/spring-aop/4.3.6.RELEASE/spring-aop-4.3.6.RELEASE.jar:/Users/username/.m2/repository/org/springframework/spring-beans/4.3.6.RELEASE/spring-beans-4.3.6.RELEASE.jar:/Users/username/.m2/repository/org/springframework/spring-expression/4.3.6.RELEASE/spring-expression-4.3.6.RELEASE.jar:/Users/username/.m2/repository/org/springframework/spring-web/4.3.6.RELEASE/spring-web-4.3.6.RELEASE.jar:/Users/username/.m2/repository/org/springframework/spring-tx/4.3.6.RELEASE/spring-tx-4.3.6.RELEASE.jar:/Users/username/.m2/repository/org/springframework/data/spring-data-commons/1.13.0.RELEASE/spring-data-commons-1.13.0.RELEASE.jar:/Users/username/.m2/repository/com/couchbase/client/java-client/2.3.7/java-client-2.3.7.jar:/Users/username/.m2/repository/com/couchbase/client/core-io/1.3.7/core-io-1.3.7.jar:/Users/username/.m2/repository/io/reactivex/rxjava/1.1.8/rxjava-1.1.8.jar:/Users/username/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.6/jackson-databind-2.8.6.jar:/Users/username/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar:/Users/username/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.6/jackson-core-2.8.6.jar:/Users/username/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.5.1.RELEASE/spring-boot-starter-web-1.5.1.RELEASE.jar:/Users/username/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.5.1.RELEASE/spring-boot-starter-tomcat-1.5.1.RELEASE.jar:/Users/username/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.11/tomcat-embed-core-8.5.11.jar:/Users/username/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.5.11/tomcat-embed-el-8.5.11.jar:/Users/username/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.11/tomcat-embed-websocket-8.5.11.jar:/Users/username/.m2/repository/org/springframework/spring-webmvc/4.3.6.RELEASE/spring-webmvc-4.3.6.RELEASE.jar: -sourcepath /Users/username/Projects/Venice/clarity/clarity-test-e2e/src/test/java: -s /Users/username/Projects/Venice/clarity/clarity-test-e2e/target/generated-test-sources/test-annotations -g -nowarn -target 1.8 -source 1.8 -encoding UTF-8
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 3 source files to /Users/username/Projects/Venice/clarity/clarity-test-e2e/target/test-classes
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/username/Projects/Venice/clarity/clarity-test-e2e/src/test/java/com/company/consumer/tools/clarity/e2e/etl/ETLHappyPathSuite.java:[6,58] package com.company.consumer.tools.clarity.etl.dao.v1.state does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Clarity - Parent Pom ............................... SUCCESS [ 0.256 s]
[INFO] Clarity - Status Service Parent Pom ................ SUCCESS [ 0.007 s]
[INFO] Clarity - Status Service Model ..................... SUCCESS [ 2.416 s]
[INFO] Clarity - Status Service DAO Components ............ SUCCESS [ 0.693 s]
[INFO] Clarity - Status Service ........................... SUCCESS [ 2.119 s]
[INFO] Clarity - Checkstyle Configuration ................. SUCCESS [ 0.034 s]
[INFO] Clarity - ETL ...................................... SUCCESS [ 0.776 s]
[INFO] Clarity - Testing E2E .............................. FAILURE [ 0.216 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.039 s
[INFO] Finished at: 2017-06-05T11:47:36-07:00
[INFO] Final Memory: 47M/536M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project clarity-test-e2e: Compilation failure
[ERROR] /Users/username/Projects/Venice/clarity/clarity-test-e2e/src/test/java/com/company/consumer/tools/clarity/e2e/etl/ETLHappyPathSuite.java:[6,58] package com.company.consumer.tools.clarity.etl.dao.v1.state does not exist
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project clarity-test-e2e: Compilation failure
/Users/username/Projects/Venice/clarity/clarity-test-e2e/src/test/java/com/company/consumer/tools/clarity/e2e/etl/ETLHappyPathSuite.java:[6,58] package com.company.consumer.tools.clarity.etl.dao.v1.state does not exist
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
/Users/username/Projects/Venice/clarity/clarity-test-e2e/src/test/java/com/company/consumer/tools/clarity/e2e/etl/ETLHappyPathSuite.java:[6,58] package com.company.consumer.tools.clarity.etl.dao.v1.state does not exist
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:152)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :clarity-test-e2e
The dependency 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ================================================================== -->
<!-- Parent -->
<!-- ================================================================== -->
<parent>
<groupId>com.company.consumer.tools.clarity</groupId>
<artifactId>clarity-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<!-- ================================================================== -->
<!-- Application Description -->
<!-- ================================================================== -->
<artifactId>clarity-etl</artifactId>
<packaging>jar</packaging>
<name>Clarity - ETL</name>
<description>
</description>
<properties>
<app.mainClass>com.company.consumer.tools.clarity.etl.ETLMain</app.mainClass>
<docker.image.prefix>dockerhub.companycorp.com/username</docker.image.prefix>
</properties>
<!-- ================================================================== -->
<!-- Dependencies -->
<!-- ================================================================== -->
<dependencies>
<!-- ================================================================== -->
<!-- Clarity Dependencies -->
<dependency>
<groupId>com.company.consumer.tools.clarity</groupId>
<artifactId>clarity-statusserv-dao</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- ================================================================== -->
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!-- ================================================================== -->
<!-- Build -->
<!-- ================================================================== -->
<build>
<plugins>
<!-- ================================================================== -->
<!-- Invoke spring boot application. -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${app.mainClass}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<useConfigFile>true</useConfigFile>
<registryUrl>https://dockerhub.companycorp.com/</registryUrl>
</configuration>
</plugin>
</plugins>
</build>
</project>
Now
👾 👾 [username]#[localhost] (master)$jar -tf
/Users/username/.m2/repository/com/company/consumer/tools/clarity/clarity-
etl/1.0.0-SNAPSHOT/clarity-etl-1.0.0-SNAPSHOT.jar | grep dao
BOOT-INF/classes/com/company/consumer/tools/clarity/etl/dao/
BOOT-INF/classes/com/company/consumer/tools/clarity/etl/dao/v1/
BOOT-INF/classes/com/company/consumer/tools/clarity/etl/dao/v1/state/
BOOT-INF/classes/com/company/consumer/tools/clarity/etl/dao/v1/
state/EtlStateDocument.class
BOOT-INF/classes/com/company/consumer/tools/clarity/etl/dao/v1/
state/EtlStateRepository.class
After running mvn dependency:build-classpath I can see clarity-etl-1.0.0-SNAPSHOT.jar (the dependency) is on the classpath.
Here is the dependent 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ================================================================== -->
<!-- Parent -->
<!-- ================================================================== -->
<parent>
<groupId>com.company.consumer.tools.clarity</groupId>
<artifactId>clarity-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<!-- ================================================================== -->
<!-- Project Settings -->
<!-- ================================================================== -->
<artifactId>clarity-test-e2e</artifactId>
<name>Clarity - Testing E2E</name>
<description>
The end to end testing for Clarity.
</description>
<properties>
<org.apache.maven.surefire.version>2.19.1</org.apache.maven.surefire.version>
</properties>
<!-- ================================================================== -->
<!-- Distribution Management -->
<!-- ================================================================== -->
<distributionManagement>
<repository>
<id>releases</id>
<name>Internal Nexus Releases</name>
<url>http://nexus.company.com/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Internal Nexus Snapshots</name>
<url>http://nexus.company.com/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<!-- ================================================================== -->
<!-- Repositories -->
<!-- ================================================================== -->
<repositories>
<repository>
<id>company-nexus</id>
<name>company Nexus</name>
<layout>default</layout>
<url>http://nexus.company.com/nexus/content/groups/public-all/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>uk.co.jemos.podam</groupId>
<artifactId>podam</artifactId>
<version>7.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
<dependency>
<groupId>com.company.consumer.tools.clarity</groupId>
<artifactId>clarity-etl</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- ================================================================== -->
<!-- Build -->
<!-- ================================================================== -->
<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>
</build>
<profiles>
<profile>
<id>e2e</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${org.apache.maven.surefire.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>${org.apache.maven.surefire.version}</version>
</dependency>
</dependencies>
<configuration>
<systemPropertyVariables>
<dbhost>${dbhost}</dbhost>
<dbuser>${dbuser}</dbuser>
<dbpass>${dbpass}</dbpass>
<saasEndpoint>${saasEndpoint}</saasEndpoint>
<cssEndpoint>${cssEndpoint}</cssEndpoint>
</systemPropertyVariables>
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
<parallel>all</parallel>
<useUnlimitedThreads>true</useUnlimitedThreads>
<properties>
<property>
<name>suitethreadpoolsize</name>
<value>20</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
I'm not sure why this is not building correctly using mvn clean install from command line, but it appears to work perfectly fine when I execute from eclipse. I think Eclipse, by default, provides all classes on classpath (regardless of scope), but I've tried different scopes to no avail.
Any help would be greatly appreciated. Thanks in advance!
You cannot use clarity-etl-1.0.0-SNAPSHOT.jar as a regular jar dependency. Notice that the classes in this jar are under BOOT-INF/classes, which is used by Spring Boot but ignored by the Java compiler.
If your goal is to test the Spring Boot application (as opposed to using the jar as a dependency), then Spring Boot provides easy ways to do it.
See, for example https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html.
If, on the other hand, it is important to include the classes in another application, then How to add a dependency to a Spring Boot Jar in another project? might help as you pointed out in the comments.
I'm currently building a new package for Hibernate project Hibernate Search and I need to run some unit tests in a managed WildFly container using Arquillian. When I use the command mvn clean install, I got the below error :
org.jboss.arquillian.container.spi.ConfigurationException: jbossHome '${project.build.directory}/node1/wildfly-${org.wildfly}' must exist
This property is configured in ./src/test/resources/arquillian.xml. Having this exception is "normal" because it has reason: the target folder ./target/node1/wildfly-10.0.0.Final does not exist. However, this path should have been configured in maven pom.xml. So I try to run maven install without tests :
Mincongs-MBP:gsoc-hsearch mincong$ mvn clean install -DskipTests=true
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Hibernate Search - JSR352 5.6.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # hs-jsr352 ---
[INFO] Deleting /Users/mincong/Documents/GitHub/gsoc-hsearch/target
[INFO]
[INFO] --- dependencypath-maven-plugin:1.1.1:set (set-all) # hs-jsr352 ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # hs-jsr352 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # hs-jsr352 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 16 source files to /Users/mincong/Documents/GitHub/gsoc-hsearch/target/classes
[INFO] /Users/mincong/Documents/GitHub/gsoc-hsearch/src/main/java/org/hibernate/search/jsr352/internal/IndexingContext.java: Some input files use or override a deprecated API.
[INFO] /Users/mincong/Documents/GitHub/gsoc-hsearch/src/main/java/org/hibernate/search/jsr352/internal/IndexingContext.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # hs-jsr352 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) # hs-jsr352 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 9 source files to /Users/mincong/Documents/GitHub/gsoc-hsearch/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) # hs-jsr352 ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.6:war (default-war) # hs-jsr352 ---
[INFO] Packaging webapp
[INFO] Assembling webapp [hs-jsr352] in [/Users/mincong/Documents/GitHub/gsoc-hsearch/target/hs-jsr352-5.6.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/mincong/Documents/GitHub/gsoc-hsearch/src/main/webapp]
[INFO] Webapp assembled in [113 msecs]
[INFO] Building war: /Users/mincong/Documents/GitHub/gsoc-hsearch/target/hs-jsr352-5.6.0-SNAPSHOT.war
[INFO]
[INFO] --- maven-dependency-plugin:2.6:unpack (unpack) # hs-jsr352 ---
[INFO] Configured Artifact: org.wildfly:wildfly-dist:10.0.0.Final:zip
[INFO] Unpacking /Users/mincong/.m2/repository/org/wildfly/wildfly-dist/10.0.0.Final/wildfly-dist-10.0.0.Final.zip to /Users/mincong/Documents/GitHub/gsoc-hsearch/target/node1 with includes "" and excludes ""
[INFO]
[INFO] --- maven-resources-plugin:2.6:copy-resources (configure-as-node-node1) # hs-jsr352 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/mincong/Documents/GitHub/gsoc-hsearch/src/wildflyConfig
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # hs-jsr352 ---
[INFO] Installing /Users/mincong/Documents/GitHub/gsoc-hsearch/target/hs-jsr352-5.6.0-SNAPSHOT.war to /Users/mincong/.m2/repository/io/github/mincongh/hs-jsr352/5.6.0-SNAPSHOT/hs-jsr352-5.6.0-SNAPSHOT.war
[INFO] Installing /Users/mincong/Documents/GitHub/gsoc-hsearch/pom.xml to /Users/mincong/.m2/repository/io/github/mincongh/hs-jsr352/5.6.0-SNAPSHOT/hs-jsr352-5.6.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.274 s
[INFO] Finished at: 2016-06-18T16:01:51+02:00
[INFO] Final Memory: 36M/280M
[INFO] ------------------------------------------------------------------------
And I noticed that :
Tests are located at step 7
WildFly installation is located at step 9
So tests are launched before runtime setup. Therefore, my questions are:
How to make sure the managed runtime WildFly 10 get unpacked before the tests ?
For my test class DeployementTest, is it part of the pre-integration / integration test ?
If yes, should I use an additional module for it ?
I'm really new on all these fields. Please forgive me if I'm mixing words up or asking stupid questions ... Thanks for your help !
Here're some related files that might be helpful :
./pom.xml
./src/test/resources/arquillian.xml
./src/test/java/org/hibernate/search/jsr352/DeploymentTest.java
./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>io.github.mincongh</groupId>
<artifactId>hs-jsr352</artifactId>
<version>5.6.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Hibernate Search - JSR352</name>
<description>New implementation mass-indexer using JSR 352</description>
<properties>
<org.jboss.arquillian.version>1.1.1.Final</org.jboss.arquillian.version>
<org.wildfly>10.0.0.Final</org.wildfly>
<org.wildfly.arquillian>8.2.1.Final</org.wildfly.arquillian>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
<profile>
<id>perf</id>
<properties>
<org.hibernate.search.enable_performance_tests>true</org.hibernate.search.enable_performance_tests>
</properties>
</profile>
</profiles>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.11.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
<version>5.5.3.Final</version>
<!--
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
-->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.batch</groupId>
<artifactId>javax.batch-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<!-- Not sure the version of EJB, this is provided by GlassFish -->
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>javax.ejb-api</artifactId>
<version>3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${org.wildfly.arquillian}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logmanager</groupId>
<artifactId>log4j-jboss-logmanager</artifactId>
</exclusion>
<!-- This exclusion is needed to be able to setup the project in Windows:
it otherwise includes transitive dependency to the JDK JConsole -->
<exclusion>
<artifactId>wildfly-patching</artifactId>
<groupId>org.wildfly</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<!-- Allows to find the absolute path to dependencies -->
<groupId>org.bitstrings.maven.plugins</groupId>
<artifactId>dependencypath-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>set-all</id>
<goals>
<goal>set</goal>
</goals>
<configuration>
<propertySets>
<propertySet>
<includes>
<include>org.jboss.byteman:byteman:jar</include>
</includes>
</propertySet>
</propertySets>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<runOrder>alphabetical</runOrder>
<systemPropertyVariables>
<!-- See HSEARCH-1444 -->
<hibernate.service.allow_crawling>false</hibernate.service.allow_crawling>
<com.sun.management.jmxremote>true</com.sun.management.jmxremote>
<org.hibernate.search.enable_performance_tests>${org.hibernate.search.enable_performance_tests}</org.hibernate.search.enable_performance_tests>
</systemPropertyVariables>
<additionalClasspathElements>
<!-- Needed by Byteman to load the agent on demand -->
<additionalClasspathElement>${jdk-toolsjar}</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.17</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>unpack</id>
<phase>pre-integration-test</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>${org.wildfly}</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/node1</outputDirectory>
</artifactItem>
<!--
<artifactItem>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-modules</artifactId>
<version>${project.version}</version>
<classifier>wildfly-10-dist</classifier>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/node1/wildfly-${org.wildfly}/modules</outputDirectory>
</artifactItem>
-->
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<!-- Copy the AS configuration files so we can use our custom configurations -->
<execution>
<id>configure-as-node-node1</id>
<!-- <phase>pre-integration-test</phase> -->
<phase>integration-test</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/node1/wildfly-${org.wildfly}</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${basedir}/src/wildflyConfig</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
./src/test/resources/arquillian.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Hibernate Search, full-text search for your domain model
~
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
-->
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<defaultProtocol type="Servlet 3.0" />
<!-- Uncomment in order to inspect deployments -->
<!--
<engine>
<property name="deploymentExportPath">target/deployments</property>
</engine>
-->
<group qualifier="Grid" default="true">
<container qualifier="container.active-1" mode="suite" default="true">
<configuration>
<property name="jbossHome">${project.build.directory}/node1/wildfly-${org.wildfly}</property>
<!-- Needed for JMS tests -->
<property name="serverConfig">standalone-full-testqueues.xml</property>
<property name="javaVmArguments">-javaagent:${byteman.agent.path}=script:${byteman.script.path} -Xmx512m -Djava.net.preferIPv4Stack=true -Djgroups.bind_addr=127.0.0.1</property>
<!-- To debug the Arquillian managed application server: -->
<!-- property name="javaVmArguments">-javaagent:${byteman.agent.path}=script:${byteman.script.path} -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y -Xmx512m -Dorg.jboss.remoting-jmx.timeout=300 -Djava.net.preferIPv4Stack=true -Djgroups.bind_addr=127.0.0.1</property -->
</configuration>
</container>
</group>
</arquillian>
./src/test/java/org/hibernate/search/jsr352/DeploymentTest.java
package org.hibernate.search.jsr352;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import org.junit.runner.RunWith;
#RunWith(Arquillian.class)
public class DeploymentTest {
#Deployment
public static WebArchive createDeployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class)
.addPackages(true, "io.github.mincongh")
.addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
.addAsResource("META-INF/batch-jobs/mass-index.xml");
System.out.println(war.toString(true));
return war;
}
#Test
public void startJob() {
// TODO: add tasks here
}
}
Perhaps you're mixing up Maven Surefire and Failsafe plugins.
DeploymentTest above is a unit test, not an IT test, that will be executed by Surefire. Therefore, if you're looking to unpack WildFly using maven-dependency-plugin, you'll need to bind unpack to a phase such as <phase>process-test-classes</phase>, that will execute before Surefire does in the test phase.
Maven Lifecycle Reference:
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference