Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

bamboo deployment to nexus repository manager

Deepak Kumar April 17, 2020

Hi,

To put it simply. I have a src file, with pom.xml file in it. My job consist of the follow task 

Source code checkout , and build using maven x3. Now the question is i want to push this artifact to nexus oss repository manager. How can this be done? i do not see solutions for this. 

1 answer

1 accepted

1 vote
Answer accepted
Lasse Langhorn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 17, 2020

Hi,

You should configure your Maven 3.x task with a goal like this:

clean install -U deploy

This assumes that the Maven executable you are using are configured to deploy to your Nexus repo.

Regards

Lasse Langhorn

Deepak Kumar April 19, 2020

Hi thank you ! :) 

The above worked for me. However, i will not be using pom.xml all the time. 

I found this following script below: 

if ((Test-Path -Path ${bamboo.build.working.directory}\uploadcheck.ps1) -ne "False") {

echo "script not found"

throw -1

}

. "${bamboo.build.working.directory}\uploadcheck.ps1"

uploadart "${bamboo.ship.buildmaster.username}" "${bamboo.ship.buildmaster.password}" "${bamboo.build.working.directory}\${bamboo.app.name.01}\" "WebApplicationMVC.zip" "${bamboo.nexus.artifactrepository.url}/${bamboo.nexus.artifactrepository.id}/${bamboo.nexus.artifactrepository.groupid}/${bamboo.app.name.01}/${bamboo.version}/WebApplicationMVC.zip"

uploadart "${bamboo.ship.buildmaster.username}" "${bamboo.ship.buildmaster.password}" "${bamboo.build.working.directory}\${bamboo.app.name.02}\" "WebApplicationSample.zip" "${bamboo.nexus.artifactrepository.url}/${bamboo.nexus.artifactrepository.id}/${bamboo.nexus.artifactrepository.groupid}/${bamboo.app.name.02}/${bamboo.version}/WebApplicationSample.zip"

uploadart "${bamboo.ship.buildmaster.username}" "${bamboo.ship.buildmaster.password}" "${bamboo.build.working.directory}\${bamboo.app.name.03}\" "WebAPI.zip" "${bamboo.nexus.artifactrepository.url}/${bamboo.nexus.artifactrepository.id}/${bamboo.nexus.artifactrepository.groupid}/${bamboo.app.name.03}/${bamboo.version}/WebAPI.zip"

uploadart "${bamboo.ship.buildmaster.username}" "${bamboo.ship.buildmaster.password}" "${bamboo.build.working.directory}\${bamboo.app.name.04}\" "WebApplicationCore.zip" "${bamboo.nexus.artifactrepository.url}/${bamboo.nexus.artifactrepository.id}/${bamboo.nexus.artifactrepository.groupid}/${bamboo.app.name.04}/${bamboo.version}/WebApplicationCore.zip"

uploadart "${bamboo.ship.buildmaster.username}" "${bamboo.ship.buildmaster.password}" "${bamboo.build.working.directory}\${bamboo.app.name.02}\" "WebApplicationSQL.zip" "${bamboo.nexus.artifactrepository.url}/${bamboo.nexus.artifactrepository.id}/${bamboo.nexus.artifactrepository.groupid}/${bamboo.app.name.02}/${bamboo.version}/WebApplicationSQL.zip"

 

Can this be used in the script task? for the deployment of artifact to nexus oss repo? Thank you. 

Lasse Langhorn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2020

Hi,

I have worked with powershell, mostly shell scripts, so I guess you will have to do some experiements with the setup.

Regards

Lasse Langhorn

Deepak Kumar April 19, 2020

Hi,

 

I have not played around with scripting, any advice how i should move forward?

How do i understand the above? no help is given in the internet. If i were to write in powershell, any tips how will it be? 

Thank you and Regards,
Deepak Kumar 

Lasse Langhorn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2020

Hi,

Sorry for not being specific. I have not worked with powershell that much. I assume your Bamboo server is running on a Windows machine.

Deploying to Nexus is best achieved by using Maven so if you are not using Maven all the time you will have to create some kind of script that can deploy your artifacts to Nexus.

But please consider using Maven when deploying to Nexus, it will make your life a lot easier. If same Java projects do not use Maven then consider using Maven.

Regards

Lasse Langhorn

Deepak Kumar April 20, 2020

Hi,

Thank you for the prompt reply ! The reason why is because i am using .NET projects and .Net framwork project, so i have to use PowerShell. Do you think you could guide me where to begin? totally stuck. Thank you ! Appreciate it truly. I will accept your answer too. 

Lasse Langhorn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2020

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events