Getting error while running mvn test with variables - selenium

I am able to trigger my cucumber tests with tags tag1 and tag2 with the below command
mvn test -Dsurefire.suiteXmlFiles=src/main/resources/testng/runner-testng.xml -Dcucumber.filter.tags="#tag1 or #tag2"
This works.
Now I modified it like this :
tag="#tag1 or #tag2"
command="-Dsurefire.suiteXmlFiles=src/main/resources/testng/runner-testng.xml -Dcucumber.filter.tags=\"#tag1 or #tag2\""
echo mvn test ${command}
mvn test ${command}
Now i can see the echo command in 3rd line is printing the correct command that needs to be run : mvn test -Dsurefire.suiteXmlFiles=src/main/resources/testng/runner-testng.xml -Dcucumber.filter.tags="#tag1 or #tag2"
But for some reason its not getting executed in line number 4. Instead i am getting below errors :
[ERROR] Suite file /Users/****/IdeaProjects/******/src/main/resources/testng/runner-testng.xml -Dcucumber.filter.tags="#tag1 or #tag2" is not a valid file
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] Suite file /Users/*****/IdeaProjects/*****/src/main/resources/testng/runner-testng.xml -Dcucumber.filter.tags="#tag1 or #tag2" is not a valid file
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:701)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:311)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:268)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1334)
Why does this happen?

Related

Build failure in data driven framework while using Jenkins pipeline

**Jenkins pipeline build is failing because of following error. I have added dependencies and plugins but still error is not going while using mvn test command in the pipeline.
The same code is working properly through Maven project job. **
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources (default-testResources) on project : C:\Users\new\.jenkins\workspace\Pipeline\target\test-classes\dataSheet\webFormstestData - Copy (2).xlsx (Access is denied) -> [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
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE

maven javadoc plugin error when used with modules Exit code: 1 - error: module not found:

I have a multi-module project that uses maven as its build system. I want to generate javadocs for the project. I do:
mvn -e javadoc:javadoc
When maven gets to the first module (Util) I get this:
Exit code: 1 - error: module not found: Util
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:javadoc
(default-cli) on project Util: An error has occurred in Javadoc rep
ort generation: [ERROR] Exit code: 1 - error: module not found: Util
[ERROR] [ERROR] Command line was: cmd.exe /X /C
"C:\Users\Warren.jdks\adopt-openjdk-11.0.7\bin\javadoc.exe #options
#packages #argfile" [ERROR] [ERROR] Refer to the generated Javadoc
files in
'C:\Users\Warren\IdeaProjects\Javabot_TOS\Util\target\site\apidocs'
dir. [ERROR] [ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:javadoc
(default-cli) on pr oject Util: An error has occurred in Javadoc
report generation: Exit code: 1 - error: module not found: Util
From the Util/target/site/apidocs dir:
argfile reads:
'C:/Users/Warren/IdeaProjects/Javabot_TOS/Util/src/main/java/module-info.java'
options reads:
--class-path 'C:/Program Files/Java/jdk1.8.0_92/lib/tools.jar;C:/Users/Warren/.m2/repository/org/apache/commons/commons-configuration2/2.7/commons-configuration2-2.7.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy/3.0.3/groovy-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-ant/3.0.3/groovy-ant-3.0.3.jar;C:/Users/Warren/.m2/repository/org/apache/ant/ant-launcher/1.10.7/ant-launcher-1.10.7.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-astbuilder/3.0.3/groovy-astbuilder-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-cli-picocli/3.0.3/groovy-cli-picocli-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-console/3.0.3/groovy-console-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-datetime/3.0.3/groovy-datetime-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-docgenerator/3.0.3/groovy-docgenerator-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-groovydoc/3.0.3/groovy-groovydoc-3.0.3.jar;C:/Users/Warren/.m2/repository/com/github/javaparser/javaparser-core/3.15.17/javaparser-core-3.15.17.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-groovysh/3.0.3/groovy-groovysh-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-jmx/3.0.3/groovy-jmx-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-json/3.0.3/groovy-json-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-jsr223/3.0.3/groovy-jsr223-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-macro/3.0.3/groovy-macro-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-nio/3.0.3/groovy-nio-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-servlet/3.0.3/groovy-servlet-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-sql/3.0.3/groovy-sql-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-swing/3.0.3/groovy-swing-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-templates/3.0.3/groovy-templates-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-test/3.0.3/groovy-test-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-test-junit5/3.0.3/groovy-test-junit5-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-testng/3.0.3/groovy-testng-3.0.3.jar;C:/Users/Warren/.m2/repository/org/codehaus/groovy/groovy-xml/3.0.3/groovy-xml-3.0.3.jar;C:/Users/Warren/.m2/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar;C:/Users/Warren/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar;C:/Users/Warren/.m2/repository/org/beanshell/bsh/1.3.0/bsh-1.3.0.jar;C:/Users/Warren/.m2/repository/commons-codec/commons-codec/1.14/commons-codec-1.14.jar;C:/Users/Warren/.m2/repository/commons-io/commons-io/2.7/commons-io-2.7.jar;C:/Users/Warren/.m2/repository/org/apache/commons/commons-jexl3/3.1/commons-jexl3-3.1.jar;C:/Users/Warren/.m2/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar;C:/Users/Warren/.m2/repository/org/apache/commons/commons-lang3/3.10/commons-lang3-3.10.jar;C:/Users/Warren/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar;C:/Users/Warren/.m2/repository/org/apache/commons/commons-text/1.8/commons-text-1.8.jar;C:/Users/Warren/.m2/repository/org/apache/commons/commons-vfs2/2.6.0/commons-vfs2-2.6.0.jar;C:/Users/Warren/.m2/repository/org/apache/hadoop/hadoop-hdfs-client/3.2.1/hadoop-hdfs-client-3.2.1.jar;C:/Users/Warren/.m2/repository/com/squareup/okhttp/okhttp/2.7.5/okhttp-2.7.5.jar;C:/Users/Warren/.m2/repository/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar;C:/Users/Warren/.m2/repository/gnu-regexp/gnu-regexp/1.1.4/gnu-regexp-1.1.4.jar;C:/Users/Warren/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.0/jackson-databind-2.11.0.jar;C:/Users/Warren/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.11.0/jackson-annotations-2.11.0.jar;C:/Users/Warren/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.0/jackson-core-2.11.0.jar;C:/Users/Warren/.m2/repository/javax/servlet/javax.servlet-api/4.0.1/javax.servlet-api-4.0.1.jar;C:/Users/Warren/.m2/repository/org/yaml/snakeyaml/1.26/snakeyaml-1.26.jar;C:/Users/Warren/.m2/repository/org/springframework/spring-core/5.2.7.RELEASE/spring-core-5.2.7.RELEASE.jar;C:/Users/Warren/.m2/repository/org/springframework/spring-jcl/5.2.7.RELEASE/spring-jcl-5.2.7.RELEASE.jar;C:/Users/Warren/.m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar;C:/Users/Warren/.m2/repository/com/sun/codemodel/codemodel/2.6/codemodel-2.6.jar;C:/Users/Warren/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.18/FastInfoset-1.2.18.jar;C:/Users/Warren/.m2/repository/com/sun/xml/dtd-parser/dtd-parser/1.4.3/dtd-parser-1.4.3.jar;C:/Users/Warren/.m2/repository/com/sun/istack/istack-commons-runtime/3.0.11/istack-commons-runtime-3.0.11.jar;C:/Users/Warren/.m2/repository/com/sun/istack/istack-commons-tools/3.0.11/istack-commons-tools-3.0.11.jar;C:/Users/Warren/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar;C:/Users/Warren/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar;C:/Users/Warren/.m2/repository/com/sun/xml/bind/jaxb-jxc/2.3.3/jaxb-jxc-2.3.3.jar;C:/Users/Warren/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.3.3/jaxb-xjc-2.3.3.jar;C:/Users/Warren/.m2/repository/com/sun/xml/bind/jaxb-impl/2.3.3/jaxb-impl-2.3.3.jar;C:/Users/Warren/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar;C:/Users/Warren/.m2/repository/com/sun/xml/bind/external/relaxng-datatype/2.3.3/relaxng-datatype-2.3.3.jar;C:/Users/Warren/.m2/repository/com/sun/xml/bind/external/rngom/2.3.3/rngom-2.3.3.jar;C:/Users/Warren/.m2/repository/org/jvnet/staxex/stax-ex/1.8.3/stax-ex-1.8.3.jar;C:/Users/Warren/.m2/repository/com/sun/xml/txw2/txw2/20110809/txw2-20110809.jar;C:/Users/Warren/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar;C:/Users/Warren/.m2/repository/relaxngDatatype/relaxngDatatype/20020414/relaxngDatatype-20020414.jar;C:/Users/Warren/.m2/repository/com/sun/xsom/xsom/20140925/xsom-20140925.jar;C:/Users/Warren/.m2/repository/org/apache/ant/ant/1.10.3/ant-1.10.3.jar;C:/Users/Warren/.m2/repository/junit/junit/4.12/junit-4.12.jar'
--patch-module Util='C:/Users/Warren/IdeaProjects/Javabot_TOS/Util/src/main/java'
-encoding 'UTF-8'
-protected
--release 11
--module-source-path 'C:/Users/Warren/IdeaProjects/Javabot_TOS/Util/target/site/apidocs/src'
-author
-bottom 'Copyright © 2020. All rights reserved.'
-charset 'UTF-8'
-d 'C:/Users/Warren/IdeaProjects/Javabot_TOS/Util/target/site/apidocs'
-docencoding 'UTF-8'
-doctitle 'Util 5.0-devel API'
-linkoffline 'https://docs.oracle.com/en/java/javase/11/docs/api' 'C:/Users/Warren/IdeaProjects/Javabot_TOS/Util/target/javadoc-bundle-options'
-use
-version
-windowtitle 'Util 5.0-devel API'
packages reads:
org.javabot.util
org.javabot.util
org.javabot.util
org.javabot.util
and javadoc.bat reads:
cmd.exe /X /C "C:\Users\Warren.jdks\adopt-openjdk-11.0.7\bin\javadoc.exe #options #packages #argfile"
The module-info.java file is located at Util/src/main/java
Can anyone shed any light on why it is not working?
To generate the JavaDoc for a Maven multi-module project, the aggregate goal(s) need to be used (eg. mvn javadoc:aggregate)
Note: As per documentation, since version 3.1.0, JavaDoc aggregation has changed: https://maven.apache.org/plugins/maven-javadoc-plugin/examples/aggregate.html
I have the same problem(s) already described within:
Java 11/12 Javadoc with maven results in not generating Javadocs for tests
So whats important are the following two points:
Use a new java version like 11.0.10 or above - no older versions!
Keep an eye at my bug report, because there seems to be a bug within maven-javadoc-plugin

Unable to build ODL sdn controller code .?

I have downloaded the code using
git clone https://git.opendaylight.org/gerrit/p/integration/distribution.git
When I try to build this, it shows following error.
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.opendaylight.integration:root:0.5.0-SNAPSHOT: Could not find artifact org.opendaylight.odlparent:odlparent:pom:1.7.0-SNAPSHOT and 'parent.relativePath' points at no local POM # line 4, column 11
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.opendaylight.integration:root:0.5.0-SNAPSHOT (/home/controller/distribution/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.opendaylight.integration:root:0.5.0-SNAPSHOT: Could not find artifact org.opendaylight.odlparent:odlparent:pom:1.7.0-SNAPSHOT and 'parent.relativePath' points at no local POM # line 4, column 11 -> [Help 2]
[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/ProjectBuildingException
You need to make sure your settings.xml points to the OpenDaylight Nexus artifact repository. The simplest way to do this is to download https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml and place it in your ~/.m2 folder (wherever that is — it depends on your operating system).
Yes, your settings.xml should be updated. An alternative way of updating (though same result as above):
Run this from your terminal:
cp -n ~/.m2/settings.xml{,.orig} ; \wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
As suggested by stephen, path may be different based on your OS. Change it accordingly.

How do i build apache Tez on hadoop 2.2.0

I am new to Apache Tez and Maven, I tried to install Apache Tez on my system. I used the following link to install ,
http://tez.apache.org/install.html
In that pom.xml present in the apache tez i have only changed hadoop and protobuf version equal to my environment which are following,
hadoop 2.2.0
libprotoc-2.4.1,
Tez-0.5.0
maven 3.0.5
java -1.7.0_65
While doing
“ mvn clean package -DskipTests=true -Dmaven.javadoc.skip=true “
i got the following error,
Error :
[ERROR] /home/karthick/work/apache-tez-0.5.0-src/tez-plugins/tez-yarn-timeline-history/src/main/java/org/apache/tez/dag/history/logging/ats/ATSHistoryLoggingService.java:[195,9] cannot find symbol
[ERROR] symbol: class TimelinePutError
[ERROR] location: class org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :tez-yarn-timeline-history
I have gone through that file ATSHistoryLoggingService.java present in the apache tez, but i couldn't understand what was happening there. I dont know how to clear History logging Service.So I have tried again as newly. That time also i got the same error. I dont know how to proceed my installation process.
Can anyone help me to solve this problem ?
Thanks in advance.
Check the BUILDING.txt file at the top of the source tree. It has a pointer for "Building against a specific version of hadoop". You are missing a "-P!hadoop24" in your maven command. Also, I believe you need protobuf-2.5.0.

Jenkins just login at the second attempt

When I do a deploy on jenkins it fails at the first attempt, but second attempt suceeds.
The same for the (web console) login. When I try to login in first time it fails, but when I retry the login suceeds. (Yes, I typed my password correctly both times).
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project test: Failed to deploy artifacts: Could not transfer artifact com.teste:test:jar:0.8.0 from/to artifactory.test.com(http://artifactory.test/libs-release-local): Failed to transfer file: http://artifactory.test.com/libs-release-local/com/test/test/0.8.0/test-0.8.0.jar. Return code is: 401, ReasonPhrase:Bad credentials. -> [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
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
Thanks.
Fix <ldapUrl> tag in /app/artifactory/etc/artifactory.config.latest.xml file