Selenium tests failing in Unix - maven

I am trying to integrate Selenium tests in Bamboo. I am able to invoke the tests on a Windows box but when I try to replicate the same on the Unix server I get the following error:
*rror 29-Aug-2012 17:03:54 17:03:54.792 WARN - Caution: '/usr/bin/google-chrome': file is a script file, not a real executable. The browser environment is no longer fully under RC control
build 29-Aug-2012 17:03:54 17:03:54.803 INFO - Launching Google Chrome...
build 29-Aug-2012 17:33:55 17:33:55.319 INFO - Killing Google Chrome...
build 29-Aug-2012 17:33:57 [INFO] ------------------------------------------------------------------------
build 29-Aug-2012 17:33:57 [INFO] BUILD FAILURE
build 29-Aug-2012 17:33:57 [INFO] ------------------------------------------------------------------------
build 29-Aug-2012 17:33:57 [INFO] Total time: 33:21.497s
build 29-Aug-2012 17:33:57 [INFO] Finished at: Wed Aug 29 17:33:57 BST 2012
build 29-Aug-2012 17:33:57 [INFO] Final Memory: 28M/164M
build 29-Aug-2012 17:33:57 [INFO] ------------------------------------------------------------------------
build 29-Aug-2012 17:33:57 [ERROR] Failed to execute goal org.codehaus.mojo:selenium-maven-plugin:2.3:selenese (test) on project iopscience-webapp: Execution test of goal org.codehaus.mojo:selenium-maven-plugin:2.3:selenese failed. SeleniumCommandTimedOutException -> [Help 1]*
I am using the selenium-maven-plugin to run the selenese tests suits. Following is the extract of my pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>2.3</version>
<configuration>
<browser>*googlechrome</browser>
<suite>Testsuite-UI.html</suite>
<startURL>http://localhost:8082/</startURL>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>integration-test</phase>
<goals>
<goal>selenese</goal>
</goals>
</execution>
</executions>
</plugin>
Please let me know if there is any specific configuration to be done on Linux to run the test suites?

Related

Using the spotbugs maven plugin, where do I put filter files?

I am trying to use spotbugs from maven.
In the <reporting/> section of my POM, I include
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.5.3.0</version>
<configuration>
<includeFilterFile>spotbugs-security-include.xml</includeFilterFile>
<excludeFilterFile>spotbugs-security-exclude.xml</excludeFilterFile>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>1.11.0</version>
</plugin>
</plugins>
</configuration>
</plugin>
Where do I put the filter files spotbugs-security-include.xml and spotbugs-security-exclude.xml?
According to the documentation, the plugin will find the filter files on the classpath. But what is the classpath for executing a reporting plugin? And where in the source tree do I put the files in order to have them copied there during report generation? I have tried src/main/resources, src/test/resources, and src/site/resources with no luck.
Log snippet:
[INFO] 6 reports detected for maven-javadoc-plugin:3.2.0: aggregate-no-fork, javadoc, javadoc-no-fork, test-aggregate-no-fork, test-javadoc, test-javadoc-no-fork
[INFO] configuring report plugin com.github.spotbugs:spotbugs-maven-plugin:4.5.3.0
[INFO] 1 report detected for spotbugs-maven-plugin:4.5.3.0: spotbugs
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.2
[INFO] 15 reports detected for maven-project-info-reports-plugin:3.1.2: ci-management, dependencies, dependency-info, dependency-management, distribution-management, index, issue-management, licenses, mailing-lists, modules, plugin-management, plugins, scm, summary, team
[INFO] Fork Value is true
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.587 s
[INFO] Finished at: 2022-02-11T15:31:56+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find resource 'spotbugs-security-include.xml'. -> [Help 1]
I run under OpenJDK 11 on linux.

How to set up pom.xml for RichFaces 4.5.17.kcc5 and Primefaces 7.0.RC3 working together on the JSF 2.3 project

Originally my project is set up for RichFaces 4.5.17.kcc5 and it works fine.
After I added the PrimeFace 7.0.RC3 library to the project, my build stop installing (mvn clean install) and I start getting the errors in the log:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:34 min
[INFO] Finished at: 2021-01-21T13:55:53+01:00
[INFO] Final Memory: 73M/1206M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.richfaces:richfaces-resource-optimizer-maven-plugin:4.5.17.kcc5:process (packed-resources) on project uifaces-resources: Exception caught when scanning class org.primefaces.component.schedule.Schedule:
[ERROR] collection: [primefaces:schedule/schedule.css, primefaces:components.css, primefaces:moment/moment.js, primefaces:jquery/jquery.js, primefaces:jquery/jquery-plugins.js, primefaces:core.js, primefaces:components.js, primefaces:schedule/schedule.js]
[ERROR] PartialOrder[primefaces:jquery/jquery.js, primefaces:core.js, primefaces:components.js, primefaces:moment/moment.js, primefaces:chartjs/chartjs.js]
[ERROR] -> [Help 1]
It happens during the execution this step:
org.richfaces:richfaces-resource-optimizer-maven-plugin
(packed-resources)
<!-- Packed -->
<execution>
<id>packed-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<pack>packed</pack>
<compress>false</compress>
<resourcesOutputDir>
${faces.resources.dir}/org.richfaces.staticResource/${version.org.richfaces}/Packed/
</resourcesOutputDir>
<staticResourceMappingFile>
${resource.mappings.dir}/optimizedResourcesMapping/Packed.properties
</staticResourceMappingFile>
<staticResourcePrefix>org.richfaces.staticResource/${version.org.richfaces}/Packed/
</staticResourcePrefix>
<excludedFiles>
<exclude>^javax.faces</exclude>
<exclude>^jquery.js$</exclude>
<exclude>^jquery.*.js$</exclude>
<exclude>^flot</exclude>
<exclude>^net.my.uifaces\:css/page.*</exclude>
<exclude>^net.my.uifaces\:css/button.css</exclude>
<exclude>^net.my.uifaces\:script/page.*</exclude>
<exclude>^net.my.uifaces\:script/jquery.*</exclude>
<exclude>^net.my.uifaces\:theme.*</exclude>
<exclude>^\Qorg.richfaces.renderkit.html.images.\E.*</exclude>
<exclude>^\Qorg.richfaces.renderkit.html.iconimages.\E.*</exclude>
<exclude>^\Qorg.richfaces.ckeditor\E</exclude>
<exclude>^\Qorg.richfaces.staticResource\E</exclude>
<exclude>^org\.richfaces:jquery\.js$</exclude>
</excludedFiles>
</configuration>
</execution>
Maybe someone has seen this error before. Any guess how to avoid it?

Jaxb2 maven plugin : Sources vs SchemaDirectory

I am making a maven project that will make use of Jaxb2-maven-plugin to generate java files out of xsd files. My Project structure is like:
project.basedir
--src/main/resources/schemas
----common
----request
----response
Below is the plugin config from pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>xjc-PDF</id>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<extension>true</extension>
<clearOutputDir>false</clearOutputDir>
<outputDirectory>${project.build.directory}/generated-sources/jaxb</outputDirectory>
<explicitAnnotation>true</explicitAnnotation>
<!-- <schemaDirectory>${project.basedir}/src/main/resources/schemas</schemaDirectory> -->
<sources>
<source>${project.basedir}/src/main/resources/schemas/common</source>
<source>${project.basedir}/src/main/resources/schemas/response</source>
<source>${project.basedir}/src/main/resources/schemas/request</source>
</sources>
<bindingDirectory>${project.basedir}/src/main/resources/schemas</bindingDirectory>
<!-- <bindingDirectory>${project.basedir}/src/main/resources/bindings</bindingDirectory> -->
<bindingFiles>jaxb-bth.xjb</bindingFiles>
</configuration>
</execution>
</executions>
</plugin>
If I compile like this then I get below error (even though the source directories contains valid schema files):
C:\ESB_SOAP5_Space\pdf-util>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pdf-util 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # pdf-util ---
[INFO] Deleting C:\ESB_SOAP5_Space\pdf-util\target
[INFO]
[INFO] --- build-helper-maven-plugin:1.6:add-source (add-source) # pdf-util ---
[INFO] Source directory: C:\ESB_SOAP5_Space\pdf-util\target\generated-sources\jaxb added.
[INFO]
[INFO] --- jaxb2-maven-plugin:1.6:xjc (xjc-PDF) # pdf-util ---
[INFO] Generating source...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.205 s
[INFO] Finished at: 2018-03-19T06:27:02+11:00
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc (xjc-PDF) on project pdf-util: No schemas have been found -> [Help 1]
However, if I comment sources and uncomment and modify like below, then I am able to generate java classes out of schemas under common.
<schemaDirectory>${project.basedir}/src/main/resources/schemas/common</schemaDirectory>
Can anyone tell me why is this behaving like this? Also what do I do if I have to parse all the schema files under one root folder ( which has multiple child folders)?
Thanks
Version 1.6 of the plugin does not support "sources" tag. You can use "sources tag on version 2.4 or newer.
If you have multiple directories containing xsds, use multiple executions in your configuration with each schemaDirectory pointing to one of your directories.

Unable to load the mojo 'sonar' - A required class is missing

Have been trying to set up sonar to run on my Jenkins instance at the end of each build. As there are restrictions on my work computer I have set up nexus to work as proxy so i can download artifacts from the central maven repository. Whenever I run my build it is successful and the tests pass however the sonar step fails.
[INFO] Building Customer 1.0-SNAPSHOT
[INFO] ---------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.3:sonar (default-cli) # Customer ---
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 2.543s
[INFO] Finished at: Mon Mar 23 11:44:46 GMT 2015
[INFO] Final Memory: 8M/156M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven- plugin:2.3:sonar (default-cli) on project Customer: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.3:sonar failed: Unable to load the mojo 'sonar' in the plugin 'org.codehaus.mojo:sonar-maven-plugin:2.3'. A required class is missing: Lorg/apache/maven/rtinfo/RuntimeInformation;
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:2.3
The required class that is missing - org/apache/maven/rtinfo/RuntimeInformation
I have tried several steps to resolve this already including cleaning my repository and restarting the build. I have also tried different versions of sonar-maven-plugin. I am currently using maven 3.0.
Any advice would be greatly appreciated!
Try to use Apache Maven 3.2.5 in combination with org.codehaus.mojo:sonar-maven-plugin:2.7.1.
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.7.1</version>
</plugin>
<!-- ... -->
</plugins>
</build>

NullPointerException when running maven-antrun-plugin for an ant build.xml that has javac

I am trying to run a build.xml (ant) in my new pom.xml in the same project. However, I always get a NullPointerException no matter what I tried at compile build.xml:104(javac). The build succeeds with ant itself.
Any insights on running build.xml in maven that has a javac target will help!
=============== Environment ===============
C:\source\GWTRPCTest>mvn -version
Listening for transport dt_socket at address: 5005
Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.6.0_31
Java home: c:\Program Files (x86)\Java\jdk6_31\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
=============== Log ===============
C:\source\GWTRPCTest>mvn package
Listening for transport dt_socket at address: 5005
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [version:setversion {execution: version}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\source\GWTRPCTest\src\main\resources
[INFO] skip non existing resourceDirectory C:\source\GWTRPCTest\src\main\resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [antrun:run {execution: generate-sources}]
[INFO] Executing tasks
init:
[mkdir] Created dir: C:\source\GWTRPCTest\build
[mkdir] Created dir: C:\source\GWTRPCTest\build\classes
[mkdir] Created dir: C:\source\GWTRPCTest\deploy
bootstrap.maven.tasks:
[mkdir] Created dir: C:\source\GWTRPCTest\build\lib
[get] Getting: http://artifactory.bpm.ibm.com:8081/artifactory/simple/ext-release-local/org/apache/maven/maven-artifact-ant/2.1.0/maven-artifact-ant-2.1.0.jar
[get] To: C:\source\GWTRPCTest\build\lib\maven-ant-tasks-2.1.0.jar
init.maven.tasks:
prepare:
[echo]
[echo] *** The file c:/source/lon.war should be from a non-development build...
[echo]
[copy] Copying 5 files to C:\source\GWTRPCTest\build\lib
extractLonAssets:
[unjar] Expanding: c:\source\lon.war into C:\source\GWTRPCTest\build\lon.war.dir
[jar] Building jar: C:\source\GWTRPCTest\build\ibm-web.jar
compile:
[javac] C:\source\GWTRPCTest\build.xml:104: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 5 source files to C:\source\GWTRPCTest\build\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: The following error occurred while executing this line:
C:\source\GWTRPCTest\build.xml:104: java.lang.NullPointerException
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 22 seconds
[INFO] Finished at: Fri Sep 06 10:53:59 CDT 2013
[INFO] Final Memory: 46M/618M
[INFO] ------------------------------------------------------------------------
I'd guess there may be a difference in the version of ant used by maven and the one on your system. Add the following line to the beginning of a target that will be executed in your build.xml file to find out:
<echo message="Ant version is: ${ant.version}"/>
Then run with both ant and your maven. If they don't match, try downloading the specific version of ant that maven is using and see if you get the same error. If so then you know this is the problem.
Update
I was able to work around this problem when I had it. You can tell the maven-antrun-plugin to use a more recent version of ant as its dependency, instead of the one it uses by default. For instance, I was able to get my antrun code to work with version 1.9.3, but it didn't with the default version of 1.8.2, so I used this code:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>generateSources</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="Ant version for antrun is ${ant.version}"/>
<!-- Other ant stuff here-->
</target>
</configuration>
</execution>
</executions>
<dependencies>
<!--The default version of ant used for antrun (1.8.2) causes above to
hit a NullPointerException. Ant 1.9.3 doesn't have this issue. -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.3</version>
</dependency>
</dependencies>
</plugin>
As you can see, I was generating source code with the antrun plugin. You will need to customize the phase, etc. for your own purposes. Hope this helps.

Resources