JSchException while using Jgit api - ant

I'm trying to clone my git repository using Jgit and I get this exception:
`java.lang.NoClassDefFoundError: com/jcraft/jsch/JSchException
at org.eclipse.jgit.transport.Transport.<clinit>(Transport.java:112)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:118)
at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:178)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:125)
`
I downloaded and copied Jsch in /lib and restarted my application (since Jgit has dependencies on this jar), I still get the same error. I'm running a java application build using ant from command line. Any other details please let me know.

Related

Issue with Jenkins failure error for Hello World java code

I am trying to learn Jenkins and Git. I have created a simple Freestyle project which takes a simple source code below from git and and prints Hello, World. The Hello_java file commits to git fine.
public class Hello {
public static void main (String [] args) {
system.out.ptintIn ("Hello, World");
}
}
The console output gives error below
Error: Could not find or lead main class Hello
what I am doing wrong?
This error comes when there is a problem with the .class file. To run this program, you need the .class file that is created when you compile the .java file. Have you compiled it (or gotten Jenkins to compile it for you)? If not, you have to do:
javac Hello.java
Then, you should be able to run:
java Hello
And everything should work.
Welcome to SO!
See this tutorial .
Steps:
code that compiles locally correctly committed in a git repo in github/bitbucket/own server etc
add a jenkins file in the repo based on the tutorial
add git repo credentials ( app password) in jenkins secrets (manage jenkins area )
create a jenkins job in pipeline mode and add your repo and select the credential and the path to your jenkins file
build
As later steps you want to see what to do with the deliverables obtained (.jar .war files etc) .
You can pack them and download from jenkins (easiest), store them in a repo (like artifactory/nexus) or build a container image with the server running that jar and push it to a docker repository (private dockerhub, gcp, aws etc) .
Note: jenkins server should have docker installed in order to get maximum flexibility from it.

Failed to execute goal org.wso2.maven:mi-container-config-mapper:5.2.18:config-mapper-parser in wso2 docker image

this is came from yesterday onwards, when i run the maven for docker project i am getting
Failed to execute goal org.wso2.maven:mi-container-config-mapper:5.2.35:config-mapper-parser (config-mapper-parser) on project ESBDockerExporter: Exception while parsing the deployment.toml file
this is the plug-in i added in docker pom.xml
There is a known issue that happening due to the new HTTPS template URL. So with the new URL HTTPS config, the older "mi-container-config-mapper" plugin has some issues.
So in order to correct this update the version in the k8s project pom file as below.
<artifactId>mi-container-config-mapper</artifactId>
<version>5.2.35</version>

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

Maven - How to force maven to consider my updated jar from local maven repository

I have a question related to maven - generating a war. Please see below.
- In one of my project (war), I am using a 3rd party jar (-SNAPSHOT version) whose entry I have made into my project pom.xml. So far it gets bundled correctly into the project war.
- But we encountered one issue in one of the java file inside this jar. For which my developer took the source code for the jar and modified-compiled and updated the jar file into local maven_repo directory.
- But whenever I build the project using maven clean:install command, my updated jar gets deleted from my local maven-repo dir and a fresh copy is downloaded from remote maven repo (where the actual 3rd party jar resides).
Can someone please help on this how can I manage so that maven use my modified jar and does not replace it with old jar during build process.
I am using maven-3.2.5.
you can run maven offline by running with the "-o" argument.
Example:
mvn clean install -o
Keep in mind that this will affect all your other dependencies and your need to have all the dependencies in your local .m2 repository.
Here is another thread taking up the issue of running maven offline:
How do I configure Maven for offline development?

wildfly:deploy-artifact with downloaded artifact from command line

I am trying to deploy a downloaded war file using the deploy-artifact goal in Wildfly. I would like to do this from the command line.
I am getting the following error
deploy-artifact must specify the artifactId
I have added the wildfly details to the pom.xml and tried to run following command:
mvn wildfly:deploy-artifact -DtargetDir=${project.build.directory}
-DartifactId=artifact-name
I think this goal is not intended to be used from the command line since it requires the artifact to be a dependency of the project. The goal documentation doesn't state any user property for the artifactId or groupId parameters so these are only settable in the configuration section of the plugin. I'm also struggling with our test setup and deployment of artifacts from our maven repo. But if you have already downloaded the artifact why don't you just use the cli to deploy it?

Resources