Teamcity 5.1 maven proxy configuration

I created a new build configuration and tried to run the same. However I encounter errors saying the artifacts could not be found in the repository. If I run the maven build from command line for the same workspace, the build works well. The proxy configuration has been mentioned in ./m2/settings.xml and the settings file has been mentioned in the build configuration. I tried even placing the proxy configuration in TeamCity\buildAgent\plugins\maven\conf\settings.xml but it does not seem to help. Kindly let me know if you have any pointers.

Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build project for plugin 'org.apache.maven.plugins:maven-site-plugin': POM 'org.apache.maven.plugins:maven-site-plugin' not found in repository: Unable to download the artifact from any repository
[16:59:48]: org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7
[16:59:48]: from the specified remote repositories:
[16:59:48]: central (http://repo1.maven.org/maven2)
[16:59:48]: for project org.apache.maven.plugins:maven-site-plugin
[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:293)
[16:59:48]: at  org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:205)
[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:184)
[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642)
[16:59:48]: at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540)
[16:59:48]: ... 19 more
[16:59:48]: Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.apache.maven.plugins:maven-site-plugin' not found in repository: Unable to download the artifact from any repository
[16:59:48]: org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7
[16:59:48]: from the specified remote repositories:
[16:59:48]: central (http://repo1.maven.org/maven2)
[16:59:48]: for project org.apache.maven.plugins:maven-site-plugin
[16:59:48]: at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
[16:59:48]: at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
[16:59:48]: at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:277)
[16:59:48]: ... 23 more
[16:59:48]: Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
[16:59:48]: org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7
[16:59:48]: from the specified remote repositories:
[16:59:48]: central (http://repo1.maven.org/maven2)
[16:59:48]: at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
[16:59:48]: at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
[16:59:48]: at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
[16:59:48]: ... 25 more
[16:59:48]: Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
[16:59:48]: at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
[16:59:48]: at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
[16:59:48]: ... 27 more

1 comment

Hello,  you've probably run your command line build under a different user and so Maven might look at different settings. Please ensure your agent is running under the proper user account or propagate your settings.xml to the agent's account.  Placing settings.xml into Maven's installation directory should help also, unless your M2_HOME variable points to another Maven installation. It's easy to check as the top of the build log shows the value of M2_HOME.

0

Please sign in to leave a comment.