How to change existing repository in Bamboo build plan? - repository

How to change existing repository in Bamboo build plan?
Note: I don't want to use add repository option, I have to replace old repo with new one.

It is an "add and remove" to replace the repo.
Click on the plan
Actions > Configure Plan
Click the Repositories tab (as shown below)
Click Add Repository and follow the steps to add a new one.
The first repository in the list is the "default", so you can now remove the old one.

Related

How to override the default plan branch configuration?

Currently we are in the process of migrating our projects from jenkins to bamboo. In this process, I am looking for an option in bamboo plan for a plan branch to be created when a new branch is created in the bitbucket repo and also when pull request is created.
As I see in the branch configuration of a plan, it is possible only to choose one option (new branch or pull request) for plan branch. is there any way where i can choose both options? Can I override the configuration using shell script? our bamboo server is currently running version 6.10.
Bamboo doesn't support multiple options for plan branch creation. What's the reason to have both options?
Before you create PR VCS branch already exists so why option to create plan branch on Bitbucket branch creation is not enough?

Bamboo does not automatically create branch in the plan

Bamboo:
On my current build plan I've checked an option create branch plan when new branch in repository is created and matches expression and set value hotfix*
Repository from the Bitbucket is of course linked to this build plan.
Bitbucket:
I have created branch named hotfix/test in Bitbucket git repository and set Bamboo plan branch.
After several hours branch was not automatically created and I have no idea what do I wrong.
I've resolved this by making the following changes:
Changed match pattern from hotfix* to hotfix/.*
Be also sure, that new hotfix repository you're creating in Bitbucket doesn't have activity older than you've set in other option Delete plan branch - After branch inactivity in repository.

Atlassian Bamboo: don't trigger build if changes were made to a specific file

I have a plan in Bamboo that starts whenever changes are made to the attached repositories (via polling).
Now, on each build, if successful, a CHANGELOG file is updated in the repo, which in turn, triggers another build. How can I omit certain files from Bamboo's polling, so that a build isn't started if changes are found for those files? Because otherwise, I enter in infinite loop, with a change to CHANGELOG triggering another build which in turn updated CHANGELOG and so on.
If this is not possible, what other viable solutions are there? Is it possible to attach a shell script somewhere before the build starts to check whether it's desired to start a new build?
It turned out that this was simpler than I've thought. In Plan Configuration, in the Repositories tab, on each repository, under Advanced, there is an Include / exclude files input where you can Customise what files Bamboo uses to detect changes. By adding a regular expression there, I got everything solved and working as expected.
Bamboo pattern matching reference: https://confluence.atlassian.com/display/BAMBOO/Pattern+matching+reference
The Bamboo Documentation says:
Bamboo will ignore build triggers if the local working copy and the
repository copy have the same revision numbers.
This might not be the best solution, but you might add an additional task at the end of the job/build which updates the repository again to avoid triggering a new build.
I'm not sure if this would then skip builds from repository updates which occur during the current build.

Maven Artifact Search is always empty

When using Alt-Insert to insert a dependency into the POM, the Artifact Search is always completely blank regardless of what I search for.
I tried to add repo1 to Settings->Maven->Repository Services, it says "no repository found." I find that hard to believe.
I've also tried to "update" my local repository but that results in an error.
FYI I'm using Community Edition Snapshot.
Thanks!
If you have a brand new IntelliJ install and have never updated your Maven Repository, notice that there is a little "Update" button to the right that becomes clickable when you click on each repository.
Preferences > Build, Execution, Deployment > Build Tools > Maven >
Repositories
The important one is the https://repo.maven.apache.org/maven2/ remote repository, make sure you update it.
I used Artifactory to generate a settings.xml for me, and by default it pointed me to the "libs-releases" repository.
Instead want my "releases" repository to point to the much larger virtual repository "remote-repos."
All it took was a simple change to the options of the "Generate Settings" function.
Weird. The Artifact Search is working fine for me with IntelliJ Community Edition, at least for artifacts from the central repo that has been indexed:
And as you can see above, all repositories declared in POMs known by IntelliJ are listed.
There might be something wrong with your Maven settings. This is a wild guess but is your Maven home directory properly defined? Same for the user settings file? Is Maven actually working fine under IntelliJ?
Solved - by reinstalling Intellij Idea
Search for class tab in Maven Artifact Search popup was always empty
Solution in linux:
remove idea folder (for me it was ~/idea-YOUR_VERSION_HERE)
remove ~/.IntelliJIdeaYOUR_VERSION_HERE folder (settings)
download new version form jetbrains.com, unzip, run installer from bin
It appears to be a blocked port, as I am using my own artifactory repository. Of course, the port it is using looks to be completely undocumented, but WireShark shows it to be 58754. Sounds random, I hope it isn't!

update location scm url for maven multi module project

I have a maven multi module project. If I need to branch, I use the maven-versions plugin to go through my project and update the parent version number rather easily. Is there a similar plugin to update my scm location in all of my poms?
Why don't you use the Maven Release Plugin and its release:branch mojo for that? From the Create a branch page:
Creating a branch executes the
following steps:
Check that there are no uncommitted changes in the sources
Change the version in the poms if you want to change it in the branch
(you will be prompted for the versions
to use)
Transform the SCM information in the POM to include the final destination
of the tag
Commit the modified POMs
Tag the code in the SCM as a new branch with a version name (this will
be prompted for)
Bump the version in the POMs if you want to change it to a new value
y-SNAPSHOT (these values will also be
prompted for)
Commit the modified POMs