Projects tigase _server server-core Issues #430
Broken pom.xml packaging type in public maven repository. (#430)
Viacheslav Blinov opened 10 years ago
Due Date
2015-02-18

Hi.

I'm trying to add your project as a maven dependency using your public maven repo. I'm building using sbt, and my build declaration looks like this:

scalaVersion := "2.11.5"

resolvers += "tigase" at "http://maven.tigase.org/"

libraryDependencies ++= Seq(
  "tigase" % "tigase-server" % "5.2.3"
)

However the dependencies can't be downloaded due to this error:

[info] Resolving jline#jline;2.12 ...
[warn] 	[FAILED     ] tigase#tigase-server;5.2.3!tigase-server.${packaging.type}:  (0ms)
[warn] ==== local: tried
[warn]   /Users/dant3/.ivy2/local/tigase/tigase-server/5.2.3/${packaging.type}s/tigase-server.${packaging.type}
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/tigase/tigase-server/5.2.3/tigase-issue #5.2.3.${packaging.type}
[warn] ==== tigase: tried
[warn]   http://maven.tigase.org/tigase/tigase-server/5.2.3/tigase-issue #5.2.3.${packaging.type}
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::              FAILED DOWNLOADS            ::
[warn] 	:: ^ see resolution messages for details  ^ ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: tigase#tigase-server;5.2.3!tigase-server.${packaging.type}
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: download failed: tigase#tigase-server;5.2.3!tigase-server.${packaging.type}

This is caused by pom.xml for tigase-server that contains this line:

<packaging>${packaging.type}</packaging>

Which obviously should be jar instead.

Screen Shot 2015-02-17 at 18.17.44.png

wojciech.kapcia@tigase.net commented 10 years ago

Viacheslav Blinov wrote:

Which obviously should be jar instead.

Actually - not.

By default it was bundle as we are making Tigase an OSGi artifact. However, we are leveraging maven properties capabilities and packaging variable is set dynamically based on what profile you use.

Viacheslav Blinov commented 10 years ago

Wojciech Kapcia wrote:

By default it was bundle as we are making Tigase an OSGi artifact.

Looking through http://maven.tigase.org/tigase/tigase-server/5.2.3/ index I can't see any bundle artifacts, only jars. The pom.xml deployed there contains packaging I wrote above, which is wrong for a deployed maven artifacts, as there is no artifact with such packaging, literally, and the 3rd party user has no info on how to substitute such properties, so it should always be final value. Hence the error of downloading using url http://maven.tigase.org/tigase/tigase-server/5.2.3/tigase-issue #5.2.3.${packaging.type} , not http://maven.tigase.org/tigase/tigase-server/5.2.3/tigase-issue #5.2.3.jar

Viacheslav Blinov commented 10 years ago

To clarify: this packaging type is wrong only in terms of final user maven repository deployed artifacts, not in terms of building on your own machine.

I don't want to build project from sources, but, instead, use it as a 3rd party library dependency, getting jars directly from your maven repository. After all, maven repositories are designed for this.

Artur Hefczyc commented 10 years ago

Wojciech, please take a look at it. Another concern is from my side is the "Target version" field. The target version set in the ticket is 5.2.3 but it is/should be closed now so how do we report issues for past/closed versions?

wojciech.kapcia@tigase.net commented 10 years ago

Artur Hefczyc, %kobit :

Another concern is from my side is the "Target version" field. The target version set in the ticket is 5.2.3 but it is/should be closed now so how do we report issues for past/closed versions?

This version wasn't set as closed therefor possibility to select it.

As for reporting issues - Target version is intended for the version in which issue should be fixes, there is another field Applicable version which correlates to version which was affected.

wojciech.kapcia@tigase.net commented 10 years ago

Viacheslav Blinov wrote:

Wojciech Kapcia wrote:

By default it was bundle as we are making Tigase an OSGi artifact.

Looking through http://maven.tigase.org/tigase/tigase-server/5.2.3/ index I can't see any bundle artifacts, only jars. The pom.xml deployed there contains packaging I wrote above, which is wrong for a deployed maven artifacts, as there is no artifact with such packaging, literally, and the 3rd party user has no info on how to substitute such properties, so it should always be final value.

OK, after a little research:

  • this is still valid in maven-centric environment: you can have any packaging type and it doesn't necessarily map 1-to-1 to the filename (custom mojo with custom lifecycle, etc.) therefore even if we set the packaging type as bundle as required to make Tigase OSGi compatible (which would still result in using .jar extension) it would still fail in SBT because it tries to find filename based on direct matching.

  • second issue is using variables - first of all - this looks like a SBT issue with parsing variables, even though all needed info is in the pom file (v. http://maven.tigase.org/tigase/tigase-server/5.2.3/tigase-issue #5.2.3.pom, 3rd line - this is the default property that should be used while reading the file)

  • lastly - maven has absolutely no problem using such repository and such files are also deployed to maven-central repository.

Viacheslav Blinov commented 10 years ago

Wojciech Kapcia wrote:

OK, after a little research:

  • this is still valid in maven-centric environment: you can have any packaging type and it doesn't necessarily map 1-to-1 to the filename (custom mojo with custom lifecycle, etc.) therefore even if we set the packaging type as bundle as required to make Tigase OSGi compatible (which would still result in using .jar extension) it would still fail in SBT because it tries to find filename based on direct matching.
  • lastly - maven has absolutely no problem using such repository and such files are also deployed to maven-central repository.

Ah, I see, not it makes more sense. This appears to be an ivy problem then, since sbt relies on ivy in dependency management. I'll create a bug report in ivy then. Thank you.

Viacheslav Blinov commented 10 years ago

For those, who'll encounter the same problem, there is a workaround - supplying the explicit artifact for a dependency:

resolvers += "tigase" at "http://maven.tigase.org/"

libraryDependencies ++= Seq(
    "tigase" % "tigase-server" % "5.2.3" artifacts( // workaround of https://projects.tigase.org/issues/2729
        Artifact("tigase-server", "jar", "jar", None, Nil, None)
    )
)
Artur Hefczyc commented 10 years ago

I guess we can close the ticket then, if not please let me know to reopen it.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
2729
Version
tigase-server-7.0.0
Spent time
9h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#430
Please wait...
Page is in error, reload to recover