Bamboo: how to produce maven artifact - maven

I've set up a Bamboo server and made a test project and plan with a Maven build task.
But this task doesn't produce any artifacts (except, maybe, test results, which I've unchecked). And I'd like to have all maven artifacts to be attached to the build results, like it is done in Hudson.
How to do that?

You can find some info on the Bamboo documentation.
This is for the latest Bamboo release (v3.4).
Also, are you running Maven with the goal package (or install) ?

Related

How to configure maven multi module project and FindBugs?

I have a multi module maven project ('assembler'), and I would like to add a FindBugs phase.
The problem is that some of the projects are not able to build stand alone since have dependencies on other projects... however when I invoke mvn package from the 'assembler' project - it works fine and all inner dependencies are resolved.
The problem is that when mvn findbugs:findbugs command is executed, those inner dependencies are not resolved, and maven complains.
Searching Google, I found a way to make it work, using mvn install, but I do not like this approach since eventually this should be used in CI with Jenkins and I do not want to rely on local maven repo on the build server.
Will appreciate hearing your ideas.
Thanks.
Don't be afraid of mvn install, it is your friend. What you need is to set up a centralized Maven repository (such as Nexus or Artifactory) or rent one (such as Bintray) to which you deploy your Maven artifacts to.
Jenkins or any other decent CI engine can do the actual deploying for you, either natively or through Maven. Once deployed, other users - Jenkins included - will be able to resolve their dependencies and you will be able to run FindBugs, PMD, JaCoco, host Javadoc or pretty much anything you want.
Side-note: Don't get confused by the term deploy as most people new to Maven usually get. In context of Maven, it has absolutely nothing to with your target environment. It simply means that an artifact is pushed out to a remote repository and nothing else.

sonar-maven-plugin with multi-module maven

I have a multi-module maven project which seems to have correctly generated OWASP dependency reports at both the parent and child module /target dirs using the org.owasp:dependency-check-maven plugin as so:
However, referencing the plugin docs, and executing the sonar-maven-plugin as below, I just can't work out what the correct command should be, any combination seems to lead to a build failure:
mvn sonar:sonar -Dsonar.sources=? -Dsonar.dependencyCheck.reportPath=?
Can anyone explain how to configure a multi-module maven project and have Sonar recognise the OWASP dependency reports?
Below is a screenshot of the starting point - we've had a CI pipeline up and running producing separate unit and integration test coverage stats for each of the submodules for some time.
Ok, so have contacted the author and the dependency-check-sonar-plugin doesn't work with a multi-module maven project.
So we are just going to produce a static artefact in a one-off fashion and not attempt to integrate with our CI pipeline.

Remove SNAPSHOT suffix from Jenkins build

I recently upgraded from hudson to jenkins. Since they are practically the same I thought it would be just plug and play. I noticed that when I build my projects my war files are being appended with the SNAPSHOT version instead of just .war. I didn't have this problem in hudson.
Is there a way to globally tell jenkins to use the release war, the one in my target directory, as it's artifact build file or have jenkins, I'm assuming the maven plugin, to not append the SNAPSHOT to the file?
SNAPSHOT is added on purpose. Don't mess with it. Either use bleeding-edge or perform mvn release:prepare release:perform in batch mode from Jenkins.

Getting Artifactory Plugin to work with Jenkins and Maven

I have a large Maven project in Jenkins. It consists of a parent project, and about a dozen local projects. Using Jenkins, I am able to do mvndeploy` and for the build to successfully deploy to my Artifactory repository.
However, I can't seem to get the Jenkin's Artifactory plugin to work itself to work.
My Artifactory setting in Jenkins:
And here's the setting for our job:
When using the Jenkins Artifactory Plugin you should execute mvn install instead of mvn deploy.
This is because the plugin collects the published artifacts from Maven and when executing mvn deploy directly you are kind of by-passing it's behavior.
Use Build Step "Invoke Artifactory Maven 3" when working with Artifactory plugin. And most preferably use goals "clean install"
I had the same problem and resolved by adding details under Build Environment -> Generic-Artifactory Integration as shown in below image
Published Artifacts now started uploading into desired location in artifactory.

Set up a project runner in Teamcity to deploy build artifacts to Artifactory

In our web-application we manage our continuous integration using TeamCity. So far we have manually added required jars and used an ant script to build and deploy our application. Lately we switched to Maven and added Artifactory to the cycle.
I need to know how to deploy our build artifacts from TeamCity to Artifactory.
I added the Artifactory plugin to TeamCity (following this guide) but when trying to add a new build step I can't seem to find any Artifactory related step (which I expect to find).
Am missing something here?
I don't think it is a separate step but actually a set of options at the end of the Maven build step itself (it should be toward the bottom).
See here for more detail:
http://wiki.jfrog.org/confluence/display/RTF/TeamCity+Artifactory+Plug-in.
Specifically, it says "The 'Deploy maven artifacts' option will only be available when using a 'Maven2' build runner."

Resources