Convert Maven Project to Jenkins - jenkins

Is it possible to convert Maven Project to Jenkins (I want to convert all the project from Maven to Jenkins)
My organization does not want to use Maven any more. The project has to be completely in Jenkins.
Please let me know the process of converting the project.
Thank you.

As Krishnan said in the comments, Jenkins is not a build tool. Jenkins is a build server that is meant for invoking build tools like Maven. It doesn't replace build tools.
So your question of converting Maven to Jenkins doesn't really make sense, since they are doing different things. However, if you are for some reason unable to use Maven, you have some alternatives. Some I can think of:
Use Gradle
Use Ant (only recommended for simply structured projects with little to no dependencies)
Use command line calls with plain javac like this: How to compile and run a simple java file in jenkins on Windows (not recommended since you have to script everything a build tool does yourself)

Related

Develop groovy scripts for jenkins in vscode or intellij

Is it possible to connect to jenkins instance to get the available libraries (including the ones from plugins) for locally developing groovy scripts with code completion in intellij or vscode?
It is not possible to have the same library as that of Jenkins instance to compile groovy inside these IDE'S.
Instead you need to have Groovy SDK installed and configured for each of there IDEs separately. (IntelliJ is simple to configure while VS Code usages .json file for all configuration). Once you have the Groovy SDK lib configured, within IDE project you can compile and run the sample .groovy (And or .gdsl) script (without any jenkins plugin).
If you are trying to trigger .jenkinsfile then, you need to change configuration in IDE to treat .jenkinsfile equal to .groovy file see below screenshot.
While it is possible to configure your Jenkins instance into IDE and also to control (Run, cancel and re-run) the jobs directly remotely in runtime from IntelliJ or from VS Code.
For this you can use;
Jenkins-Control-Plugin - IntelliJ IDEA
To Configure Jenkins instance is very simple.
see the Link here
Jenkins Jack(many other plugins are available but this is most popular) - VS Code.
I Struggled a bit to configure the Jenkins Jack but with this you can compile the Groovy and trigger it remotely.
see the link JenkinsJack
Jenkins Runner - VS Code
This is same as that of Jenkins Control Plugin mentioned in point 1.
My favorite is VS code with Jenkins Jack simple and effective.

Can I disable a maven plugin from command line?

Is there a way to execute a maven build from command line, but disable a configured plugin without changing the pom file?
The reason for that is, that we have a number of given maven projects, which we develop together with a customer. In these projects a rpm plugin is configured, which does not run in our Windows environment. So I'd need a way to control the build in a way that it just ignores this build step without having to change the pom file (like using profiles, which I would use, if I were able to change it). Unfortunately the plugin does not have a skip property.
The only other idea I had was faking the rpm command which is called in the plugin, but this didn't work.

Jar files for DL4J - using DL4J without building using Maven

I want to use DL4J [https://deeplearning4j.org/] and tried the instructions on the setup guide [https://deeplearning4j.org/gettingstarted]. I am facing problems while building using Maven (build failure). Do I need to really use Maven to build everything. I just want to write some basic programs and run the examples which comes with DL4J. I am unable to find a list of jar files which i can import into my project and compile the examples. Any help is appreciated.
The developers suggest to stick to Java 8 to avoid dependency-problems with Maven. If you are using Java 9 or OpenJDK (like on Linux), consider a switch to Java 8 to get Maven running.
You should consider to use IntelliJ IDE which manages automatically dependencies download and integration with maven.
If you're already using IntelliJ try to remove m2 folder (which contains all maven dependencies) and choose auto-import option in settings of the IDE.
You can try to use the last maven version too by download it and then configuring it into settings.
Like gurvinder372 said, more information about your problem should be great for us.

How do you organize ant macrodefs used by multiple projects?

I would like each of my Git repositories to have their own build.xml file, but avoid having to copy paste a lot of macrodefs used by the different build scripts.
What would be the best way to organize this?
Adding the ant macrodefs to a seperate Git repository and make them available for all the build projects on my Jenkins server?
Adding them for instance to a directory of the Ant installation folder?
Does anybody have some experience with this kind of setup?
I do the same. I feel strongly that every project should be stand-alone and not depend on another source code repository. To achieve this I package my common macrodef's as an ANTLib. These are simply jar files that can be imported into the ANT build like other 3rd party tasks.
The following answer explains how to create an antlib:
How to manage a common ant build script across multiple project build jobs on jenkins?
The really big advantage of this approach is when you save the ANTlib jar in a versioned repository like Nexus. I use ivy to manage my dependencies and this allows my common build logic to be versioned, enabling me to safely change logic without breaking older builds. When you think about it this is the same kind of workflow implemented by Maven (which also downloads plugins).

How to easily publish non-Maven artifacts from Jenkins to Bintray?

Is there an easy way to publish non-Maven artifacts to a generic repository on Bintray from a Jenkins job? I've been reading through Deploying Maven and Gradle snapshots to OJO but that applies to Maven-compatible artifacts / Maven repositories only.
I'm aware that I could use the Bintray REST API, but that's a bit too low-level for my taste. I'm wondering if there's something for Jenkins like the Artifactory Plugin, but for use with Bintray.
The closest thing I've found so far is a Bintray REST API wrapper like this Perl module, but I don't like that either as I'd need to install the module on all Jenkins nodes then.
For Bintray, there is Bintray Java Client. We are going to release the new version, which supports file upload and signing in the following week or so.

Resources