Can't get Maven 3.5.x to work with TC 2017.1.3: can't find org.sonatype.maven:wagon-ahc:1.2.1
When I try to use Maven 3.5.X with TC 2017.1.3, I get the following error:
[12:44:41][Step 1/2] [INFO] Scanning for projects...
[12:44:41][Step 1/2] [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/sonatype/maven/wagon-ahc/1.2.1/wagon-ahc-1.2.1.pom
[12:45:03][Step 1/2] [ERROR] [ERROR] Some problems were encountered while processing the POMs:
[12:45:03][Step 1/2] [ERROR] Unresolveable build extension: Plugin org.sonatype.maven:wagon-ahc:1.2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.sonatype.maven:wagon-ahc:jar:1.2.1 @
[12:45:03][Step 1/2] @
[12:45:03][Step 1/2] [ERROR] The build could not read 1 project -> [Help 1]
[12:45:03][Step 1/2] [ERROR]
[12:45:03][Step 1/2] [ERROR] The project com.odfl.core-components:common-annotations:2.0.0-SNAPSHOT (D:\TeamCityBuildAgent\work\37f6407dc34102f5\pom.xml) has 1 error
[12:45:03][Step 1/2] [ERROR] Unresolveable build extension: Plugin org.sonatype.maven:wagon-ahc:1.2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.sonatype.maven:wagon-ahc:jar:1.2.1: Could not transfer artifact org.sonatype.maven:wagon-ahc:pom:1.2.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.184.215] failed: Connection timed
Maven shouldn't be trying to download the jar directly from repo.maven.apache.org. Maven does not behave this way if I run the build on the agent via the command-line. Using Maven 3.3.9 works with no other changes.
Maven shouldn't be trying to download the jar directly from repo.maven.apache.org. Maven does not behave this way if I run the build on the agent via the command-line. Using Maven 3.3.9 works with no other changes.
Please sign in to leave a comment.
Hi Bob,
Sorry, just to be on the clear: "Using Maven 3.3.9 works" you mean 3.3.9 works within TeamCity while 3.5 doesn't? Does 3.5+ work properly from the command line?
Yes.
Yes.
How have you set 3.5 up? Did you install it as a custom one?
Also, when running from the command line do you mean logging in into the agent? Or setting up a command line step from within teamcity? When trying from the command line, did you try running it as the same user that runs the teamcity process?
I'm not quite sure how 3.3.9 was added. 3.5.0 was added by placing the distro zip in the server's plugin/.tools directory, from which it was propagated to all agents.
command-line execution: I started a windows CMD window in a project's build directory on an agent and issued a Maven command, (e.g., mvn clean package)
Hi Bob,
3.3.9 is bundled with teamcity, but 3.5 isn't, that's why i was asking how you got it.
You CD'd into the directory and issued the maven command. Is the maven issued there the same 3.5 version that was deployed to the agent via teamcity? If you have multiple versions installed and multiple are on the path, you should ensure this first.
The cmd you started in the agent, was it with the same user the build agent process is running? Or is the agent running as system?
As you can imagine, it's not particularly common that 3.3.9 works and 3.5 doesn't, and that 3.5 works on a command line. This difference is often an issue with a difference in the environment between the teamcity process and the command line you started, often a difference in the user. Unless the mvn in the PATH is not the 3.5 version (or not the one distributed), which could lead to 3.5 having actually the issue in this situation.
In summary, could you check:
-That the mvn command you issue in the cmd is actually using 3.5 and not a different maven on the path
-whether you run it as the same user than the agent runs.