graphstream/gs-ui — pull request #1 by rlegendi (2013-06-04 20:10:54+00:00)
Title: Cross-building enabled for different Scala versions (well, almost :-))

I'm not sure how useful this is but I was in the need of it so thought it may worth a pull request.

So the issue is that I had a binary compatibility issue: tried to run the `TestStars2` demo with Scala 2.10. The loading of `AttributeUtils` died because of the missing `ClassManifest` class (that has been marked as deprecated before and removed from the 2.10 build). It turned out you also use Scala in the code :-)

So here's a proposal: so far the Scala version was not included in the build proces of the *gs-ui* project, which is common in Scala projects (take a look on the builds of [Specs2](http://oss.sonatype.org/content/repositories/releases/org/specs2/) and [ScalaTest](https://oss.sonatype.org/content/repositories/releases/org/scalatest/) for example).

I'm not too familiar with your building/publishing process, but I made a few minor additions to the project's POM.

This way you can build against Scala 2.9 (as it was previously to maintain compatibility) with the usual:

mvn clean package

command. On the other hand, you can also specify a profile to build against Scala 2.10 like:

mvn -P scala-2.10.1 clean package

for instance.

The drawback is that I wasn't able to find a way with Maven to build it similarly to other projects, namely, to include the Scala version number in the `artifactId`. My problem is that I don't like having a property reference in the `artifactId` element, it may confuse some additional tools (e.g., installing into the local repo may confuse Sbt/Ivy, because it would resolve the variable to its default value, so it might complain against invalid group references and so on).

So my solution was to use classifiers as it was suggested in several places.

This way the user may use a given version of `gs-ui` with:

org.graphstream
gs-ui
1.2-SNAPSHOT
2.9.0

Or the same with Sbt:

libraryDependencies ++= Seq(
"org.graphstream" % "gs-ui" % "1.2-SNAPSHOT" classifier "2.10.1"
)

Unfortunately the `%%` operator cannot be used (since the Scala version is included in the artifact id), and the `classifier "2.10.1"` postfix is required, which is quite non-standard, but I wasn't able to find any better solution for this issue.

So that was my local hack to the issue, but I would be really interested in hearing your opinion about it.

Cheers,
Richard