Not Able to debug my application after build with maven - maven-3

I've build my web project with maven3 and then deployed on jboss, m able to access the application but when I trying to debug the source code, it is showing source not found. Is there any way to debug the source code after maven build and deployment??

Have you added below options in standalone.conf file to enable application debugging
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y

Related

sonar-swift to analyse xcode project

Im trying to analyse swift app using SonarQube. followed the instructions from here
Im able to run the sonarqube server and running sonar-scanner while running it I'm getting this error
com.sonarsource.A.A.B.A: No license for swift
I'm using this plug in, backelite-sonar-swift-plugin-0.2.4.jar i feel this plug in is free and we can use it. correct me it I'm wrong.
What I did was:
Download Sonarqube LTS version (https://www.sonarqube.org/downloads/)
Download and install dependencies and Sonar-Swift from https://github.com/Backelite/sonar-swift (including sonar-scanner)
Download sonar-project.properties (https://gist.github.com/Edudjr/db51907068ea76b116d11d9a9b13f05f#file-sonar-project-properties) and configure it according to your project. Place it in your project root folder.
Download run-sonar-swift.sh (https://gist.github.com/Edudjr/79a2379842357c33709aecf040d9ae77#file-run-sonar-swift-sh), place it in somewhere in your mac and add to path (/etc/paths). I did a small change in the script because oclint was not running properly.
Start your Sonarqube server (sonar.sh console in sonar folder) and run run-sonar-swift.sh in your project root folder. You should be done.
Manual Installation
In the page dedicated to the plugin you want to install (ex: for Python : SonarPython), click on the "Download" link of the version compatible with your SonarQube version.
Upload the downloaded jar file in your SonarQube Server and put it in the directory : $SONARQUBE_HOME/extensions/plugins.
If another version of the same plugin is already there, you need to remove it, since only one version of a given plugin may be available in the extensions/plugins directory.
Once done, you will need to restart your SonarQube Server.
https://docs.sonarqube.org/display/SONAR/Installing+a+Plugin
Backelite Sonar-Swift last release:
https://github.com/Backelite/sonar-swift/releases

intellij grails unable to resolve external library at groovy compile time

I'm writing a simple etrade programmatic trading program that needs to authenticate with etrade oauth. I'm using IntelliJ Ultimate with Grails 3.1.9.
I added a folder full of jars to Project Settings->Libraries and Project Settings->Modules->main project (accessible by pressing "command ;") and selected "export." The classes resolve fine in the groovy editor in my controller class but they don't resolve at groovy compile time. Why is that?
~/IdeaProjects/<project name>/grails-app/controllers/etradescripter/ETradeUserController.groovy: 8: unable to resolve class com.etrade.etws.sdk.client.ClientRequest
# line 8, column 1.
import com.etrade.etws.sdk.client.ClientRequest;
Grails use the Gradle build system, which is comparable (superior IMHO) to maven.
It is completely external to the IDE itself and not dependend to any IDE.
It is a very powerfull external build tool which has it's own tooling, dependency management,
library cache and logs.
The libraries and SDK you declare in Intellij project structure settings are for IntelliJ internal support (intellisense, code assist, decompiling etc) not for building and/or debugging
The gradle tooling support for your project (found in File/Settings/Gradle) can be:
a gradlew declaration in the project : the project will use it's own
build system version downloaded from the specifications in
gradle/wrapper/gradle-wrapper.properties file with the accompanying
gradle-wrapper.jar downloader - this is the recommended way to go if you are not comfortable with the system to avoid
problems but disk consuming and not the fastest build. There will be a gradle binary distribution download for the first build
a Gradle version bundled with Intellij (2.13 for the last IntelliJ version I think)
one you can declare in the project settings (ie your own Gradle installation root, you have to install it before and set the right
environment variables to make it work) for the last one it can be a
"daemon" version which speeds up thing notably but is very cpu and
memory expensive for a large project (be prepared for 100% cpu and
memory hogs for a large project whatever computer you have).
The main file for build where you declare the build and debug dependencies is "Build.gradle" file at the root of your project.
Dependencies are declared with lines (Groovy syntax, gradle is a groovy tool) like:
dependencies {
assets "com.craigburke.angular:angular-template-asset-pipeline:2.2.6"
assets "com.craigburke.angular:angular-annotate-asset-pipeline:2.4.0"
assets "com.craigburke:js-closure-wrap-asset-pipeline:1.2.0"
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
etc...
This is where you have to add your own dependencies, not in IntelliJ SDK/lib settings.
This is comparable to the maven system with a different syntax (groovy).
For jars comming from an external repo or local dependencies, you should see lines that you can copy/paste and modify.
If not look at gradle docs
especially 23.3 and 23.4, how to declare you dependencies.
There can be other gradle files in gradle directory and/or subprojects directory. It depend on your project.
To build your project, you can open the Gradle tool window in IntelliJ (View/Tool Windows/Gradle), select the build task (Task/build/build), double click on it and it will launch the build.
This will change the run/debug configuration in the IntelliJ IDE so you can build it again with the IDE toolbar by clicking on the Run button
Note: the run button runs the currently selected gradle task, not the application, this is a bit confusing at the beginning
To run or debug you app, you select the appropriate task, in case of Grails task, application/bootrun and double click on it.
This will launch your application (after a build if needed), and if it is a web app, you can browse you application in your browser.
When you run the Run task (not the build task) you can also click on 'Debug' icon to debug your application
If you select another task and click debug, you will have a socket exception because IntelliJ thinks you are launching a jvm and tries to connect to it for debugging.
(they are lots of predefined task in Gradle : assembling jars, building docs etc... and the Run task may be specific to a project
Generally Build tasks are under the build category and run task under the application category)

How to debug the Jenkins plugin

I have built a new "Hello World" plugin for Jenkins and I was able to upload it onto Jenkins and it works successfully. I am now trying to make change to the plugin and debug it on Jenkins.
Note:
My Jenkins is deployed in my local tomcat, i build the hpi file and copy it to jenkins plugins folder, it works.
Now i want to ask how can i debug my plugin code? Suggestions with any IDE is welcome.
I also have questions about:
do i need to create a project for jenkins source in my IDE and develop my plugin base on it?
Currently i only create a project for the plugin, build a hpi file and put it to Jenkins.
I am not sure if this step is correct.
Thanks in advance!
I imagine you ran
mvn package
to create your package
To debug you can do
mvnDebug hpi:run
and this will copy all the dependencies down (rather than in your jenkins install) and run it in place
If you are using an IDE then this can be done from within it.
More help can be found in the plugin tutorial
Follow the tutorial to set MAVEN_OPTS, and using IntelliJ to add a Jetty Server to point the port to it.
execute from cmd:
mvn clean
set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
mvn hpi:run
add a debug local Jetty Server from intelliJ and point it to port 8000 (port number is specified in above cmd)
In case of IntelliJ IDEA the easiest way is to use maven's Run/Debug configuration.
Just add hpi:run in "Command line" filed and start Debug as usual.
When the console says that your "Jenkins is fully up and running", open a browser and go to http://localhost:8080/jenkins/ and your code will stopped at break point (if any).

ANT Script Build Messages into a log4j configured log file

I am developing a java project using Eclipse as IDE and ant as the build tool. For logging I am making use of log4j library. I am able to get the log messages in a log file for my whole application using log4j configuration.
But when I build project using ANT, the ANT build messages are still posted to console.I want to make sure that when I build the project, the build messages that ANT generates, like build failure/success, should also be posted to that sames logger file using log4j.
Please help me in this if anyone has got an idea. Thanks
To pass the logging log4j, you can use this when you run Ant:
$ ant -listener org.apache.tools.ant.listener.Log4jListener
The configuration of log4j is then up to you. See the information on Listeners in the Ant manual.

How do I automate testing using nUnit as part of a build process using compiled dll's in .Net?

I'm using psake, msbuild and nUnit to automate my build and testing of an MVC web app, which will be carried out (kindly), by Jenkins, once I have it working.
My build steps work fine, creating two DLL's in the build\bin dir:
MyWebApplication.dll
MyWebApplication.Tests.dll
I'm using nunit-console.exe to run the automated tests as part of the psake build script, pointing it at the newly built MyWebApplication.Test.dll. However, the tests fail due to is saying it could not load file or assembly MyWebApplication.dll, despite it being in the same directory as the test dll file.
How do I go about executing tests using nunit in this scenario?
It's most likely looking for the application .dll in the workspace root, which is the current directory by default in Jenkins. Try changing the current directory to %WORKSPACE%\build\bin before launching the test.
I found the answer to my own question.
I had to compile a debug version of my projects as part of the build script, then run the Nunit console exe against my csproj file for the test project. With this, it executes the tests properly.

Resources