Netbeans RCP application are built with Ant. How can I build with SBT and integrate in Jenkins?
There's a SBT plugin which allows Ant targets to be called.
First build ant4sbt from sources:
git clone http://github.com/sbt/ant4sbt.git
cd ant4sbt
sbt publish-local
Create a file properties/sbt-ant4sbt.sbt like this:
addSbtPlugin("de.johoop" % "ant4sbt" % "1.1.2")
Create a build.sbt on the root of your Netbeans RCP application:
import de.johoop.ant4sbt.Ant4Sbt._
antSettings
addAntTasks("build-osgi") // creates task antRunBuildOsgi
addAntTasks("run-osgi") // creates task antRunRunOsgi
Now you can build OSGi bundles from command line and run it inside a container, like this:
sbt antRunBuildOsgi
sbt antRunRunOsgi
Building in Jenkins is as easy as calling sbt antRunBuildOsgi but you will have to copy dependencies to the library directory you defined in your Netbeans IDE. After the build you will also have to copy artifacts to the place you distribute artifacts of your builds.
See also: Cannot build OSGi bundle for a Netbeans RCP application
Related
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.
I am building a gradle project and the source code is in git. After checking our repo to jenkins' workspace, how do i have jenkins go to a sub-directory and do the build?
I tried adding shell commands but cd will not work as it executes script on a separate shell.
If you are building a gradle project, perhaps you should use the "Invoke gradle script" step rather than a shell script?
As part of the gradle build script, it has an option to specify the "Root Build script", which will let allow you to specify a subdirectory if you wish.
See the Gradle plugin for more information.
How to locate build.gradle file ?. Under which folder i need to create build.gradle file ? I am saving all my .jmx test files under jmeter/bin folder
Do i need to create a new java project in IDE to use Gradle?
Please provide detail steps to integrate Gradle jmeter plugin with jmeter + Jenkins
To create a standalone gradle project that runs jmeter tests, you can create a new folder and add a file build.gradle to it, with the following contents:
plugins {
id "net.foragerr.jmeter" version "1.0.3-2.13"
}
Create a folder src/test/jmeter and place all your test .jmx files there.
From jenkins you can run gradle jmrun to run tests and gradle jmreport to generate reports.
I'm able to successfully build the Maven assembly plugin in my project and generate a jar file with all the needed dependencies. But now I also want to instruct Maven after building me the jar file with dependencies, go into the target folder where the jar file with dependencies is located and run my main program.
Should I consider looking into the Maven Exec Plugin for what I want to acheive?
Yes the exec-maven-plugin is the right choice. The question is if you like to start the assembled jar archive or just a java class with it's dependencies.
I am trying to install prerequisties for workflow for xpages.I could not pass the below requirement. I installed ant, set the home pates, it works for a simple echo like "ant -build c:\test.xml"
Where is the setup folder to run "ant setup.activiti" command? it is not in ant"apache-ant-1.9.2" folder?
Make sure Apache Ant installed in the system, go to setup folder and run command(This
will download Activiti libraries needed in our project): ant setup.activiti
In setup there is the build.xml file ant uses. setup.activiti is a target inside that ant file. You only need to do that when you want to mess with the source build from source / contribute