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

Suddenly maven does not compile - Unable to get dependency information - related to velocity

Sorin Sbarnea (Citrix)
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.
July 31, 2012

Suddenly my project does not compile anymore, maven complaining about:

ownloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.6.4/velocity-1.6.4.pom
10K downloaded  (velocity-1.6.4.pom)
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.6.4-atlassian-4/velocity-1.6.4-atlassian-4.pom
11K downloaded  (velocity-1.6.4-atlassian-4.pom)
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity-tools/1.3/velocity-tools-1.3.pom
7K downloaded  (velocity-tools-1.3.pom)
[INFO] artifact org.apache.velocity:velocity: checking for updates from atlassian-public
[INFO] artifact org.apache.velocity:velocity: checking for updates from atlassian-plugin-sdk
[INFO] artifact org.apache.velocity:velocity: checking for updates from atlassian-maven1
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'ab18c81da3da981ecf90d0502b024e23eca7bb4b'; remote = '<!DOCTYPE' - RETRYING
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'ab18c81da3da981ecf90d0502b024e23eca7bb4b'; remote = '<!DOCTYPE' - IGNORING
[INFO] artifact org.apache.velocity:velocity: checking for updates from atlassian-contrib
[INFO] artifact org.apache.velocity:velocity: checking for updates from central
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Unable to get dependency information: Unable to read local copy of metadata: Cannot read metadata from '/Users/sorin/.m2/repository/org/apache/velocity/velocity/maven-metadata-atlassian-maven1.xml': end tag name </body> must match start tag name <hr> from line 7 (position: TEXT seen ...</address>\n</body>... @9:8) 
  org.apache.velocity:velocity:jar:null

from the specified remote repositories:
  atlassian-plugin-sdk (file:///Users/sorin/dev/jira/jira-libs.hg/sdk/repository),
  central (http://repo1.maven.org/maven2),
  atlassian-maven1 (http://maven.atlassian.com/maven1),
  atlassian-contrib (https://maven.atlassian.com/contrib),
  atlassian-public (https://m2proxy.atlassian.com/repository/public)

Path to dependency: 
	1) com.xensource.jira:testrun:atlassian-plugin:1.1
	2) com.atlassian.jira:atlassian-jira:jar:5.1.1
	3) com.atlassian.velocity.htmlsafe:velocity-htmlsafe:jar:1.1.1

bash-3.2$ cat /Users/sorin/.m2/repository/org/apache/velocity/velocity/maven-metadata-atlassian-maven1.xml
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://maven.atlassian.com/maven1/org/apache/velocity/velocity/maven-metadata.xml">here</a>.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at maven.atlassian.com Port 80</address>
</body></html>

What's the cause and solution?

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
Bhushan Nagaraj
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.
September 25, 2012

This resolved the issue for me

1. Upgraded Atlas SDK to 4.0

2. Deleted all artifacts in my local .m2 repository

ramishka November 12, 2012

Thanks. This method works. However I found that you don't need to delete the entire repo to get it working. Usually, the build error will point to a package name, for example in my case it was this:

org.apache.velocity:velocity:jar:null

Browse to yor local .m2 repo. Locate the velocity folder inside the repo (folder strucutre = package strucutre given in error message). Delete the velocity folder and rebuild. This should fix it.

suny itec April 10, 2013

Had this issue on my mac (using sdk 4.1.6) and Ramishka sulution worked for me. I navigated to my /Users/username/.m2/repository/org/apache and deleted the velocity folder under that directory then ran my atlas-run command and it all worked.

Thanks,

Leon

leonizm April 23, 2013

Had this issue on my mac (using sdk 4.1.6) and Ramishka sulution worked for me. I navigated to my /Users/username/.m2/repository/org/apache and deleted the velocity folder under that directory then ran my atlas-run command and it all worked.

Thanks,

Leon

2 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 23, 2013

Everything worked for my JIRA plugin yesterday, but today I get a similar error to you:

$ atlas-run -v 5.2
Executing: /usr/local/Cellar/atlassian-plugin-sdk/4.1/libexec/apache-maven/bin/mvn com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:4.1.5:run  -Dproduct.version='5.2'
Colorizing console...
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Awesome Plugin for JIRA
[INFO]    task-segment: [com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:4.1.5:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing amps-dispatcher:run
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

No versions are present in the repository for the artifact with a range [1.5,1.6.100)
  org.apache.velocity:velocity:jar:null

from the specified remote repositories:
  atlassian-plugin-sdk (file:///usr/local/Cellar/atlassian-plugin-sdk/4.1/libexec/repository),
  central (http://repo1.maven.org/maven2),
  atlassian-public (https://m2proxy.atlassian.com/repository/public)

Path to dependency: 
	1) me.davidsimpson.jira.plugins.awesome:awesome-plugin-for-jira:atlassian-plugin:1.4.1-SNAPSHOT
	2) com.atlassian.jira:atlassian-jira:jar:5.2
	3) com.atlassian.velocity.htmlsafe:velocity-htmlsafe:jar:1.1.1

Deleting from my local maven repo fixes this:

$ rm -rf ~/.m2/repository/org/apache/velocity/*
$ atlas-run -v 5.2
Executing: /usr/local/Cellar/atlassian-plugin-sdk/4.1/libexec/apache-maven/bin/mvn com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:4.1.5:run  -Dproduct.version='5.2'
Colorizing console...
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Awesome Plugin for JIRA
[INFO]    task-segment: [com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:4.1.5:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing amps-dispatcher:run
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.6.4/velocity-1.6.4.pom
10K downloaded  (velocity-1.6.4.pom)
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.6.4-atlassian-4/velocity-1.6.4-atlassian-4.pom
11K downloaded  (velocity-1.6.4-atlassian-4.pom)
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity-tools/1.3/velocity-tools-1.3.pom
7K downloaded  (velocity-tools-1.3.pom)
[INFO] artifact org.apache.velocity:velocity: checking for updates from atlassian-public
[INFO] artifact org.apache.velocity:velocity: checking for updates from atlassian-plugin-sdk
[INFO] artifact org.apache.velocity:velocity: checking for updates from appfusions-all-snapshots
[INFO] artifact org.apache.velocity:velocity: checking for updates from appfusions-all
[INFO] artifact org.apache.velocity:velocity: checking for updates from central
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.6.3/velocity-1.6.3.pom
10K downloaded  (velocity-1.6.3.pom)
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.6.3/velocity-1.6.3.jar
411K downloaded  (velocity-1.6.3.jar)
[INFO] [jira:copy-bundled-dependencies]
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.6.4-atlassian-4/velocity-1.6.4-atlassian-4.jar
440K downloaded  (velocity-1.6.4-atlassian-4.jar)
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity-tools/1.3/velocity-tools-1.3.jar
131K downloaded  (velocity-tools-1.3.jar)
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.5/velocity-1.5.pom
7K downloaded  (velocity-1.5.pom)
Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/velocity/velocity/1.5/velocity-1.5.jar
382K downloaded  (velocity-1.5.jar)
[INFO] [dependency:unpack-dependencies]
...
[INFO] [jira:run {execution: virtual-execution}]
[WARNING] ************************************************************
Version 4.1.7 of the Atlassian Plugin SDK is now available.
Run the atlas-update command to update.
************************************************************

So what's changed? Nothing on my end, other than I've had a few hours sleep.

It looks like a new release of Atlassian Plugin SDK could be the likely cause.

0 votes
Morten Sigsgaard May 22, 2013

My 50 cent in this; move your .m2/settings.xml to an alternate location whilst using the Atlassian Plugin SDK.

Issue might be caused by maven locating the dependency under another repository over which the atlassian dev team has no control.

In my case, i had filled in the settings.xml from suggested repositories in a tutorial. The SDK offers its own, however the general SDK repository settings are merged with the local .m2/settings..

$ mv ~/.m2/settings.xml ~/.m2/settings.xml.bak

Sorted it out for me, clean your local repository branches that introduces errors if they persist.

0 votes
Sorin Sbarnea (Citrix)
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.
July 31, 2012

Think I found the cause: atlassian changed something in the webserver configuration and HTTP is answering with a redirect.

Changing your config to use https:// solves the problem.

Still, this is bug in SDK as the URL used to generate the pom.xml file is now invalid.

And also a bug in maven (for not properly detecting 301 redirects).

Bhushan Nagaraj
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.
September 24, 2012

I changed the pom.xml and replaced http with https but still get the same error.

<repositories>
        <repository>
            <id>atlassian</id>
            <url>https://maven.atlassian.com/repository/public/</url>
        </repository>
        <repository>
            <id>atlassian-m1</id>
            <url>https://maven.atlassian.com/maven1/</url>
        </repository>
    </repositories>

Can you please let me know if you were able to resolve the issue and how you managed to resolve it?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events