Maven project integration with Jenkins #selenium scripts - java

I am trying to run selenium scripts on Jenkins locally on my computer. I was using eclipse project and then i converted it to Maven by configure>convert to maven project. My Jenkins configuration is
Look at the configuration in the images. This is what I have done so far. I am a beginner to all this so don't know what I am missing. My console output on Jenkins is

Try this:
/user/Gauravgandhi/Documents/workspace/Applico/Website
for file system path and just pass pom.xml under Root Pom text box and define goals for the same.
I am hoping you configure JDK and Maven at jenkins level under configure jenkins link.
Please let me know if it works or not.

Gaurav,
Please make the setup using admin user in your machine or give full permission to your current user at every level.

Related

How to let maven project work locally by intelij-idea?

We have a maven project works fine in a internet enabled environment, now we need make it work in a local environment by IntelliJ IDEA Community Edition .
we have try following actions:
in setting->build->maven:
check the box "work offline"
download all needed jars into a local folder
in settings.xml set local Repository, such as
C:\FCA\Repository
4.build the project, it seems that some packages can be find in pom.xml(no error message in pom.xml), but can't be find in java code , and build failed. You can refer to attached picture for details
How can we get it done locally? thanks a lot!
Under "Settings -> Build, Execution, Deployment -> Maven" you can find options:
Maven home directory
User settings file
Local repository
There you have to provide path to your local maven installation (by default IntelliJ has it's own Maven provided). It should automatically read your settings.xml file and set local repository. If not please also provide those two and it will work fine with your local libs.
First of all, run mvn dependency:go-offline. Then you can build in offline mode as long as you don't change any of the dependencies.
If you do this to work inside a company with several developers, think about setting up a Nexus/Artifactory for you company.

Maven in eclipse or windows

I'm planning to create a java maven web project. I would like to know whether I have to install Maven in windows or install maven in eclipse? I'm using windows 10 and eclipse oxygen. My network has some restrictions so I would be adding a proxy in settings.xml.
I have already tried creating a maven project in eclipse with maven embedded in my eclipse, but it was giving multiple errors during jars download.
Please suggest me on which way I should proceed and which way is better, whether I should use maven in eclipse or install in windows and use?
Usually, you use the embedded Maven in Eclipse, which is part of a standard modern Eclipse installation.
If you get errors with jar downloads, this is probably an issue with your network. Whether putting a proxy in the settings.xml is enough to remedy the problem depends on you actual network.
To find out the exact network restrictions, talk to your admin.
I think you should just try use a different network to create your maven project (for example you can use tethering or ask for permission to get around those network restrictions). After that you should be able to use your maven project even offline.
An alternative would be to just download a maven project and change it to your own.
You can try installing maven:
Go to maven's website to install/configure maven for your os
Set Maven's settings.xml
Configure Maven in your eclipse, choose the installed maven rather than embedded
If your have any errors, please post them here.

Appium Maven tests with Travis CI tool

I am kind of struggling with transitioning from Jenkins to Travis-CI. Running an Appium (or consider it Selenium) project that is built using Maven. I am not sure what really should go into the travis.yml file. From what I have been told I need to do a before_install, before_script, and script, and after (after not sure). Could someone please be nice of kind enough to paste a travis.yml that was created for Java Maven project.
Also not sure I will get the test running on a physical device for a tool that is hosted on the Cloud. For Jenkins all we would do is hook up the device to the master/slave.

Cucumber works on Eclipse but not on Jenkins

I am successfully running Cucumber test on my java/maven eclipse project. But when I add my project do Jenkins I always get the following error "cucumber.runtime.CucumberException: No features found at []".
I read in this thread Setting cucumber-jvm options in Maven from the command line that:
...tests are running in separate JVM, so you need to specify that system property in the test plugin configuration (i.e. surefire or failsafe plugin config in your pom.xml)
But I am not quite sure how to do this. Can anyone help me?
PS: I am using "cucumber-java" and "cucumber-junit" dependencies.
If you're using surefire, the plugin documentation page http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html shows few options you can try to set system properties
For example you can try the systemPropertyVariables plugin settings
do you see the feature files in your target folder on your Jenkins slave ? maybe your *.feature files get excluded because of an incorrect config of your resources exclusion/inclusion in Maven ?

Managing Maven project in Eclipse with git repository

we recently migrated to Maven Build manager & git hub repository for our Java web-app. Also i switched to eclipse as eclipse has good set of plugins.
As a new bie, i am simply running mvn clean package from terminal at the code root directory. And then moving the compiled code i.e., /target/SNAPSHOT/* to tomcat/webapps/ROOT location.
And then starting Tomcat7 server. The process is time taking especially when i do code changes in Java & configuration .xml files.
I want to do it completely in IDE environment as i did earlier in Netbeans, update code -> build and run in debug mode, -> do code changes and then commit.
Heard of egit & m2e in eclipse for maven & github integration, but not sure how to use it.
Please walk me through the steps required in doing so. I am completely new to eclipse.
--
Thanks
You might want to consider using maven-jetty-plugin http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin for running the webapp. You will not need to copy over stuff to tomcat. After configuring this plugin, you can simply run your application by doing mvn jetty:run
I generally do not like running webapps inside Eclipse. It's a personal prefrence, but it is always nice to have an IDE neutral way of building and running your applications. If you have m2e things should work simply fine. I have seen maven-jetty-plugin having hot pluggability where if you changed your web.xml, jetty would reload your application.
We use Git for version control and Maven for dependency management and build automation. Once your project has successfully imported into Eclipse and recognized as a valid java web project, you don't need either Git or Maven in order to build/run it inside IDE. Just creat a server using you existing tomcat installation, add the project to server, then select Run as > Run on Server.
The Complete Guide:
Creating a server
Adding projects to a server
Starting a server
For more details, check out Testing and publishing on your server.

Categories

Resources