sbt confused with maven dependency that has variables

479 views
Skip to first unread message

Kostas Kougios

unread,
Oct 26, 2012, 5:36:55 PM10/26/12
to simple-b...@googlegroups.com
I've published 2 maven artifacts of mine. Both refer to scala's version in a variable ${scala.version} . This variable is declared inside 2 profile declarations, 1 for scala 2.9 and one for scala 2.10

So there are 2 profiles: scala2.9 and scala2.10 and the pom can be viewed here : http://repo1.maven.org/maven2/com/googlecode/classgenerator/classgenerator/0.6.5-2.9.2/classgenerator-0.6.5-2.9.2.pom

Now I got this simple sbt file:

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.4")

libraryDependencies += "com.googlecode.mapperdao" % "mapperdao" % "1.0.0.rc15-2.9.2"

Mapperdao depends from classgenerator. But it seems the profiles+variables of classgenerator confuse sbt:

[warn]     :: com.googlecode.classgenerator#classgenerator;0.6.5-2.9.2: several problems occurred while resolving dependency: com.googlecode.classgenerator#classgenerator;0.6.5-2.9.2 {compile=[compile(*), master(*)], runtime=[runtime(*)]}:
[warn]     java.text.ParseException: inconsistent module descriptor file found in 'http://repo.typesafe.com/typesafe/releases/com/googlecode/classgenerator/classgenerator/0.6.5-2.9.2/classgenerator-0.6.5-2.9.2.pom': bad revision: expected='0.6.5-2.9.2' found='0.6.5-${scala.version}';
[warn]     java.text.ParseException: inconsistent module descriptor file found in 'http://repo1.maven.org/maven2/com/googlecode/classgenerator/classgenerator/0.6.5-2.9.2/classgenerator-0.6.5-2.9.2.pom': bad revision: expected='0.6.5-2.9.2' found='0.6.5-${scala.version}';
[


Any ideas why so?

Josh Suereth

unread,
Oct 26, 2012, 7:02:32 PM10/26/12
to simple-b...@googlegroups.com

I didn't realize ivy had issues with this, bad it's actually pretty bad form to release poms that she profiles for accuracy.   You should release with the effective pom to prove resolution speed and accuracy for your clients.

That said, it looks like an ivy bug.  I'll let mark chime in on ticket issueing and I'll also implore you not to release a pom with profiles in it (although for development it's great).

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/MLKjDhRqiZkJ.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.

Konstantinos Kougios

unread,
Oct 28, 2012, 7:32:40 PM10/28/12
to simple-b...@googlegroups.com
Thanks Josh, how do I release with the effective pom? Can't find anything about this.

Konstantinos Kougios

unread,
Jan 22, 2013, 4:10:06 PM1/22/13
to simple-b...@googlegroups.com
On my side I had to use effective poms to make my artifacts compatible with sbt:

mvn help:effective-pom -P scala2.10 -Doutput=tmp.pom
mvn -f tmp.pom clean source:jar scala:doc-jar package deploy

mvn help:effective-pom -P scala2.9.2 -Doutput=tmp.pom
mvn -f tmp.pom clean source:jar scala:doc-jar package deploy

that's a workaround till the issue is resolved.

On 22/01/13 13:42, Adam Jorgensen wrote:
What is the status of this issue. I am trying to make use a project that has been released with a pom including profiles and so far had no luck getting it to work in SBT...
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/oIGmedgtNkAJ.

Adam Jorgensen

unread,
Jan 22, 2013, 11:25:19 PM1/22/13
to simple-b...@googlegroups.com
Thanks!

Dave Thomas

unread,
Oct 28, 2014, 4:41:06 PM10/28/14
to simple-b...@googlegroups.com, kostas....@googlemail.com
Let me just rescuscitate this thread to point out the heroism therein.  After hours of googling, it solved my problem and I was thrilled.  Then weeks later I had to search my inbox to find this thread.

Is this fixed with updated SBT or Ivy?
Reply all
Reply to author
Forward
0 new messages