Is there any maven command can run on Jenkins shell to analyze typescript code in SonarQube? - jenkins

I want to do static code analyze for typescript Jenkins job using SonarQube. I can do it by installing tsLint lib to my project and compile gulp file in Jenkins, but I think it is not a developer friendly method. Is there any maven command can run on Jenkins shell to analyze typescript code in SonarQube.

you can use this sonarqube plug-in https://github.com/Pablissimo/SonarTsPlugin... This plugin works with tslint but it is no official sonarqube plugin... In my case it works perfectly

Related

Jenkins build without maven

I have a java project which I build and export it as a jar using eclipse. Then I deploy the jar.
Also my project uses dependencies e.g. Apache POI etc. I include these jars in the build path and then clean build and export it as a jar.
I want to build the jar using Jenkins. Please suggest the script and command to perform the same task without using maven. I have to build the code from Gitlab.

Sonarqube with dotnet core works fine on command line but not from Jenkins

I'm trying to launch Sonarqube on a .NET Core 2.0 solution from Jenkins using SOnarQube MsBuild on Windows.
It works fine when i execute the following script from Jenkins workspace:
C:\SonarQube\bin\MSBuild.SonarQube.Runner.exe begin /k:XXXX.Campaigns /n:CI /v: /d:sonar.host.url=http://x.x.x.x:9000 /d:sonar.verbose=true /d:sonar.projectBaseDir="C:\Program Files (x86)\Jenkins\workspace\CI"
dotnet clean
dotnet build
C:\SonarQube\bin\MSBuild.SonarQube.Runner.exe end
But when i execute the same command from Jenkins, i got this message:
The SonarQube MSBuild integration failed: SonarQube was
unable to collect the required information about your projects.
Possible causes:
The project has not been built - the project must be built in
between the begin and end steps.
An unsupported version of MSBuild
has been used to build the project. Currently MSBuild 14.0 upwards
The begin, build or end steps have not all been
launched from the same folder
I use Jenkins 2.46.2 - MSBuild 15 - Sonarqube 6.7 & Sonar MsBuild 4.0.2.892. I tried using Jenkins build steps, command step, command step with a script without success. On a classical .Net 4.5.2 project, it works.
Jenkins was running as local system user. I change it to a normal Windows user and it did the trick. dotnet build was not using Sonarqube dedicated targets.
Thanks you #Valeri!

how to run Selenium tests in Jenkins

I want to run my Selenium Webdriver Maven tests in Jenkins. I've followed the tutorial: https://www.guru99.com/maven-jenkins-with-selenium-complete-tutorial.html and https://www.safaribooksonline.com/library/view/jenkins-the-definitive/9781449311155/ch04s06.html
But now, I want to run each of hundreds tests that I've written in Selenium Webdriver with Eclipse.
I use Maven to create testng.xml (where I have my Maven projects to can execute a list of tests in the same execution).
I use Eclipse to write Java to create tests in Selenium Webdriver.
I use github to import tests.
I show you my github project... I don't know how to access into the different folders to execute each testng.xml files, sorry, I'm pretty new here.
Could anybody help me with this issue?
Thanks so much!!!!
Create a freestyle Jenkins job and then go to the configuration page of your job and in Source Code Management section add the URL of your Git repo where you have kept your TestNG tests. This will help to bring the tests from the repository to your workspace.
Then go to the Build section and select Execute windows batch script if and then add the following script:
java -cp ".;/path/to/testng-x.x.x.jar;/path/to/jcommander-x.xx.jar;/path/to/test-classes" org.testng.TestNG /path/to/test.xml
For Linux use the following script with Execute shell in `Build step:
cd /path/to/test.xml
java -cp "/path/to/testng-x.x.x.jar:/path/to/bin" org.testng.TestNG testng.xml
Where /bin folder contains the compiled code for the TestNG tests.
Then save the job and run the build to execute TestNG test cases.
Note: You can find the required JAR files inside the .m2 folder.

POM not released using Jenkins and Artifactory Release

We're trying to use the Artifactory release process in Jenkins to publish a jar file created by a Gradle build into a Maven repo in our Artifactory server.
It nearly all works, the only issue is that the pom file isn't being copied into the Artifactory repo.
The Gradle build includes the Gradle Maven plugin and running gradlew install locally results in both the jar and the pom inserted into the local Maven repo.
I've added a task in the Gradle build that generates the pom file in the same directory as the jar file and changed the Jenkins build to run that task too.
When the build has completed I can see both the jar and the pom file in the workspace.
Any ideas on what I need to do to get the pom file published along with the jar?
We're using:
Jenkins 2.10
Artifactory plugin 2.4.4
Gradle 2.14
The Gradle build file does not inlcude the Gradle Artifactory plugin.
Cheers, Andy
The Jenkins project is configured to use the Gradle-Artifactory integration (rather than the Generic-Artifactory integration).
As suggested by Dakota Brown I'm answering my own question, the solution to my problem was to un-tick the maven3 integration option. With that option unslected, everything works as expected.

Compile NMAKE created make files in Jenkins

I am quite new to Jenkins and build, so my question can be silly.
I have installed Jenkins and successfully installed plugins under jenkins MSbuild, Nant and Clear Case plugin and its giving expected output.
Problem is I have my own makefiles created in NMAKE for each components and i want to compile it with cmake as it there is no other way to compile NMAKE under jenkins.
just not getting ways to do it, please tell me the plugin to be used to compile make files created using namke under jenkins.
Xshell plugin is the solution.
It runs all my NMAKE scripts on cmd and i get the expected output. thanks for prompt response slav.
Don't know anything about cmake/nmake, but there is a cmake plugin for Jenkins, and this blog post shows configuration and mentions nmake. Is that not enough?

Resources