Thursday, October 31, 2013

Use environment variable in Jenkins editable email notification subject.

Today, i am gonna describe a solution to send the Jenkins email notification with editable subject instead of default subject each time depending upon the current environment variable.
                                                                                                 This can help you in the case when you have a Jenkins build,which builds with user provided environment variable according to requirement and then you may also want to get the email notification after completion with the subject having environment variable used to trigger build.

I assume you have created a Jenkins job as per your project requirements :

Step 1 : Configure the build parameters [ User defined environment variable ]
For Example

Step 2 : Add Editable email notification as after build action  :

Step 3 : Update the Default subject as given in screenshot to include the user given environment variables in email notification.
For Example
If you have user defined parameter 'testsite' with value '', then to send the parameter value in email notification update the default subject field as :
${ENV, var="testsite"}

Step 4 : Save the job configuration and its ready to go :)

Tuesday, January 22, 2013

How to create Maven in-project repository

Pre-requisites :You should have Maven installed on your system.

In my example i am using "sshxcute-1.0" jar file. You can download it from link"

Follow the below steps :

1. Create a "lib" folder in your java project.(Actually the name does'nt matter you can use "library" instead or whatever you like)

2. Copy the "sshxcute-1.0" jar file in "lib" folder.

3. Open command prompt and navigate to "lib" folder, then execute following command.(In my case 'sshxcute-1.0.jar' file is at "c:\project\src\com\lib" location,so you need to change file locations in below  command accordingly)

mvn deploy:deploy-file -Durl=file:///c:\project\com\src\lib -Dfile=sshxcute-1.0.jar -DgroupId=com.automatethebox -DartifactId=automatethebox -Dpackaging=jar -Dversion=1.0

 Note that you get BUILD SUCCESS on console output after running the command.

4. Now go to your project "lib" directory, and notice that an package "com.automatethebox.apis" is created.This is your in-project maven repositoy.

5. Now Open the project "pom.xml" file

6. Add following dependency in pom.xml file :


7. Add following repository in pom.xml file :


NOTE : You need to update this path in url according to your project.

8 .Then refresh the Maven dependencies for the project using your IDE Maven > Reimport option.

All done, now you can use the classes from the Jar file and maintain your Maven project with your in-project Maven repository.

AWS Certified Solutions Architect Associate - AWS Introduction - Questions

All the Best !!! Show Result !! Try Again !! ×