How to install the Jenkins cucumber plugin

1. Click the Manage Jenkins link on the left-hand navigation:

manage Jenkins

2. Click Manage Plugins

manage plugins

3. Click Advanced Tab on the Manage Plugins Page

advanced

4. Click Choose File and locate the Jenkins-cucumber.hpi file you downloaded earlier

  • Click Upload to upload the hpi file to the Jenkins server

upload

5. Click the Available Tab and scroll down to the bottom of the page

  • Click the install without restart button

install

6. Check the Restart Jenkins when installation is complete and no jobs are running box

restart

7. After Jenkins restarts go back to the Manage Plugins page and click the Installed Tab

  • Check cucumber-reports is installed and is ticked and the version is correct

installed

Configure the Plugin Once Installed

1. Ruby Cucumber – Open the configuration page for your job

  • If you are using ruby cucumber add a build shell step with cucumber --format json -o cucumber.json
  • Check the box: Publish cucumber results as a report
  • Enter the path relative to the job workspace where your cucumner.json file that you specified in the build step above is generated

Configuration

2. Cucumber JVM – Open the configuration page for your job

  • If you are using maven and cucumber-jvm add a build shell step with maven clean install
  • Check the box: Publish cucumber results as a report
  • Enter the path relative to the job workspace where your cucumber.json file that you specified in the build step above is generated

Configuration

3. Link to the report

  • Once the report is generated you can open it via link displayed on project details panel or on the job panel

Link to the report

Notes on Configuration

  • The Json Reports Path field in the config should point to the directory where your cucumber.json file is generated. So the easiest way to check is to view the job workspace (click on the workspace link from the job page) and click down the directory structure until you find where your cucumber.json file lives. (assuming you have run the build at least once) then enter the path in the config field: e.g. target if your workspace contains the directory target at the top level and you use maven. If your target directory is further down in your file structure – put the path to it e.g. dir1/dir2/target
  • The field already supplies the path to the workspace with a trailing slash (/) so you just need to supply the bit afterward e.g. [/path/to/the/workspace/] target <– you supply this bit (target)
  • The second config field is for when you have Jenkins installed somewhere other than the default hostname:8080 – if you have it at http://hostname:8080/jenkins then the assets and stylesheets won’t be found and you have to supply the path to it which in this case would be: /jenkins/
  • The assets are retrieved from the path http://hostname:8080/name_of_plugin/plugin_files_are_here – so in the case above http://hostname:8080/jenkins would be http://hostname:8080/jenkins/name_of_plugin/various_assets – you would have to supply the path to the name_of_plugin with both the leading and trailing slash (/) e.g. /jenkins/

How to push local git project to the remote git repository

Below are the steps to push local git project to the remote git repository

  1. Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub.
  2. Open Terminal.
  3. Change the current working directory to your local project.
  4. Initialize the local directory as a Git repository.
  5. Add the files in your new local repository. This stages them for the first commit.
  6. Commit the files that you’ve staged in your local repository.
  7. At the top of your GitHub repository’s Quick Setup page, click to copy the remote repository URL.
  8. In Terminal, add the URL for the remote repository where your local repository will be pushed.
  9. Push the changes in your local repository to GitHub.

Important: If username or password has not appeared while cloning the repo, try below command
git clone https://myusername:mypassword@github.com/path_to/myRepo.git

How to get Current Year, Month, Day, Hour, Minute, Second, Millis in Java

Below is the working java class to get the current time with all attribute.

Please leave your comment for any questions.