Cobertura plugin building does not work

Hi,

I am trying to follow the steps at https://bitbucket.org/i386/bamboo-cobertura-plugin/overview to build a cobertura plugin, but the process fails with the error message below.

Any hints on how to fix it?

solutions@bamboo:~/test/bamboo-cobertura-plugin$ mvn package -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/com/atlassian/maven/plugins/maven-bamboo-plugin/4.0/maven-bamboo-plugin-4.0.pom
[INFO]
Unable to find resource 'com.atlassian.maven.plugins:maven-bamboo-plugin:pom:4.0' in repository central (http://repo1.maven.org/maven2)
Downloading:
http://repo1.maven.org/maven2/com/atlassian/maven/plugins/maven-bamboo-plugin/4.0/maven-bamboo-plugin-4.0.pom
[INFO]
Unable to find resource 'com.atlassian.maven.plugins:maven-bamboo-plugin:pom:4.0' in repository central (http://repo1.maven.org/maven2)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: com.atlassian.maven.plugins:maven-bamboo-plugin

Reason: POM 'com.atlassian.maven.plugins:maven-bamboo-plugin' not found in repository: Unable to download the artifact from any repository

com.atlassian.maven.plugins:maven-bamboo-plugin:pom:4.0

from the specified remote repositories:
central (http://repo1.maven.org/maven2)
<br< a="">> for project com.atlassian.maven.plugins:maven-bamboo-plugin


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project for plugin 'com.atlassian.maven.plugins:maven-bamboo-plugin': POM 'com.atlassian.maven.plugins:maven-bamboo-plugin' not found in repository: Unable to download the artifact from any repository

com.atlassian.maven.plugins:maven-...


http://repo1.maven.org/maven2)
<br< a="">> for project com.atlassian.maven.plugins:maven-bamboo-plugin
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.loadPluginFully(DefaultLifecycleExecutor.java:1599)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findArtifactTypeHandlersInPlugins(DefaultLifecycleExecutor.java:1468)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findExtensions(DefaultLifecycleExecutor.java:222)
at org.apache.maven.lifecycle.Def...

















http://repo1.maven.org/maven2)
<br< a="">> for project com.atlassian.maven.plugins:maven-bamboo-plugin
at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:293)
at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:205)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:184)
at org.apache.maven.plugin.DefaultPluginManager.loadPluginFully(DefaultP...







http://repo1.maven.org/maven2)
<br< a="">> for project com.atlassian.maven.plugins:maven-bamboo-plugin
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:277)
... 19 more
Caused by: org.apache.mave...




http://repo1.maven.org/maven2)

<br< a="">> at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
... 21 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact...







1 answer

1 accepted

Hello Ferenc,

Are you using Atlassian Plugin SDK bundled-in maven? My guess would be that you are using plain maven, which has no atlassian's public maven repositories configured - that's why it complain about missing artifacts... Could you try downloading Atlassian Plugin SDK and use 'atlas-mvn' from it instead of 'mvn' ?

Does it make sense?

Thank you, Yes, it fixed the error above ... Now I get the following:


[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/home/solutions/i386-bamboo-cobertura-plugin-2d35b690ebb5/src/main/java/com/atlassian/bamboo/plugins/cobertura/CoberturaResultWebItemCondition.java:[39,45] BUILD_KEY is not public in com.atlassian.bamboo.plugins.cobertura.tasks.CoberturaTask; cannot be accessed from outside package

.....


/home/solutions/i386-bamboo-cobertura-plugin-2d35b690ebb5/src/main/java/com/atlassian/bamboo/plugins/cobertura/CoberturaResultWebItemCondition.java:[41,54] BUILD_NUMBER is not public in com.atlassian.bamboo.plugins.cobertura.tasks.CoberturaTask; cannot be accessed from outside package

/home/solutions/i386-bamboo-cobertura-plugin-2d35b690ebb5/src/main/java/com/atlassian/bamboo/plugins/cobertura/CoberturaResultWebItemCondition.java:[42,40] BUILD_NUMBER is not public in com.atlassian.bamboo.plugins.cobertura.tasks.CoberturaTask; cannot be accessed from outside package

/home/solutions/i386-bamboo-cobertura-plugin-2d35b690ebb5/src/main/java/com/atlassian/bamboo/plugins/cobertura/CoberturaBuildProcessorServer.java:[70,20] cannot find symbol
symbol : method getLastSuccessfulBuildSummary(java.lang.String)
location: interface com.atlassian.bamboo.resultsummary.BuildResultsSummaryManager


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18 seconds
[INFO] Finished at: Tue Dec 18 12:30:46 CET 2012
[INFO] Final Memory: 94M/313M
[INFO] ------------------------------------------------------------------------

and one more "annot be accessed from outside package
", I had to remove due to space limitation in this comment.

Nevermind the compile errors, I have bamboo 4.3 so the API seems a little bit incompatible. Here is the fix:

1. in ./src/main/java/com/atlassian/bamboo/plugins/cobertura/tasks/CoberturaTask.java make the symbols public

2. in ./src/main/java/com/atlassian/bamboo/plugins/cobertura/CoberturaBuildProcessorServer.java
replace the complained about line with:

PlanKey pk = PlanKeys.getPlanKey(buildContext.getPlanKey());
            BuildResultsSummary previousSummary = (com.atlassian.bamboo.resultsummary.BuildResultsSummary)buildResultsSummaryManager
                    .getLastSuccessfulResultSummary(pk);

It should work now.

Just curious - do you consider pushing back (via pull-request) your changes to the https://bitbucket.org/i386/bamboo-cobertura-plugin repository, so these changes can be shared among the community?

Not sure if that is feasible though...

I will try tomorrow :)

Cannot create a pull request, however I have created a mercurial bundle file. I will contact the previous developer to see what should I do with it.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,493 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you