Jenkins NuGet packaging with versioning for Java application?

Hello, I am working on a project to deploy Java application to Linux using Octopus. One key point is to get NuGet package with automatic versioning from Jenkins server. The Jenkins server runs on Windows.

I’d like to know if someone has experience to share to get versioned NuGet package for Jenkins Java application build.

I know there is one Jenkins NuGet plugin. But it is for .NET project build.

Hi Edward,

Thanks for getting in touch!

You could use this docs page as a guide, but instead of using OctoPack use Octo.exe to pack the output of your build into a NuGet package and then push that to Octopus.

Hope that helps!

Thank you and kind regards,

Hi Henrik,

Thanks for quick response. I read the page; but I found that doc is for MS .NET solution. How can I apply to a Java web application?


Hi Edward,

I’m not that familiar with Java web applications anymore (haven’t done Java since university), but I’ll attempt to give you some further guidance.

Your build process should produce some build outputs of your web app and put those in a folder on the filesystem, you can use Octo.exe to pack those files into a NuGet package that you can then push to Octopus. Octo.exe does not need a .nuspec file, it just packs all the files in the folder as-is.

For exampl:
octo.exe pack --id={YourPackageName} --basePath={JenkinsBuildOutputPath} --outFolder={PathToWhereYouWantThePackage} --version={JenkinsBuildNumber}

I hope that helps.


Now we use Octo.exe to do the packaging from the command line. Can’t this packaging be automated after a successful build.?