Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbt should validate maven model before publishing #2566

Open
MasseGuillaume opened this issue Apr 19, 2016 · 7 comments
Open

sbt should validate maven model before publishing #2566

MasseGuillaume opened this issue Apr 19, 2016 · 7 comments

Comments

@MasseGuillaume
Copy link
Member

MasseGuillaume commented Apr 19, 2016

I downloaded all Scala 2.11 poms from maven central (~50 000 poms). Almost 10% fails to load because they are invalid poms.

For example: you cannot duplicate license tags, but sbt permits that magneticio/vamp#612

Maven model builder can validate a pom. Usage example

steps

create an invalid pom (for example magneticio/vamp#612)
publish

problem

sbt does not validate the model

expectation

I expect sbt to validate the pom before publishing

@MasseGuillaume
Copy link
Member Author

or get rid of pomExtra and provide a dsl for it

@dwijnand
Copy link
Member

dwijnand commented Apr 21, 2016

pomExtras is a pretty blunt tool, but I'm not sure if sbt should be validate the pom by default. Perhaps this could be a community ticket for an sbt plugin to validate it.

@MasseGuillaume
Copy link
Member Author

well since publish is part of sbt I think it should be in the core of sbt

@dwijnand
Copy link
Member

dwijnand commented Apr 21, 2016

test is part of sbt, but sbt doesn't come built in with scalacheck..

It's also about adding another/more dependencies..

@dwijnand
Copy link
Member

Also an sbt plugin could eventually be folded into sbt.

Or we could add it as a feature, off by default, or on by default with a flag to disable it..

@nafg
Copy link
Contributor

nafg commented Apr 22, 2016

An easier, partial solution, at least for the magneticio case, is that instead of building the pom from sbt settings first, and then appending pomExtra, you start with pomExtra and then you append nodes in the XML. So when you generate the XML for the licenses key, for instance, if the licenses node exists your append in it.

@adamvoss
Copy link

Would a Java dependency to Maven Model Builder be acceptable, or would an implementation need to be Scala in order to be acceptable?

Does anyone know if XSD validation would suffice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants