arktekk / sbt-aether-deploy

Deploy SBT artifacts using Maven Artifact Resolver (formerly Eclipse Aether)
Other
84 stars 31 forks source link

Write valid maven-metadata.xml for sbt plugins #65

Closed ptab closed 3 years ago

ptab commented 3 years ago

Fixes #64

In order to write a valid maven-metadata.xml file the behaviour of org.apache.maven.repository.internal.VersionsMetadata needs to be changed, so that it writes the artifactId element using the correct format $name_$scalaVersion_$sbtVersion.

Unfortunately, the class VersionsMetadata class is final and internal so it's not possible to simply extend its behaviour, so I'm forced to create a whole new implementation and replace all the generators, all the way from Booter.scala. For this reason, the following classes were copied directly from the Maven sources but not modified:

I decided to simply copy these classes as is, so that if Maven changes them it's easy to compare them and apply patches. I've also considered rewriting them in Scala, but it has the disadvantage of diverging further from Maven and possibly creating new bugs.

hamnis commented 3 years ago

Well done! Thanks