-
Notifications
You must be signed in to change notification settings - Fork 931
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
Making use of Ivy source | javadoc configs to resolve sources and javadocs #1004
Comments
The current behavior is the Maven way, which is for better or for worse the de facto correct way in the Java ecosystem. By default, Ivy will try to lookup these It is true that Ivy dependencies aren't handled and that could be improved. Do you mean sbt itself should depend on sources/javadoc for dependencies or that it should make projects do that by default? (Also, I believe you'd need |
Sorry about the formatting.
I'm not sure exactly what you mean by "sbt itself should depend on sources/javadoc for dependencies". If it's that a sbt project's sources & javadoc ivy configs should depend on its dependencies' sources & javadoc ivy configs, then yes, I'm suggesting that. Ultimately I'd like the source jars of all my project's deps to be brought to the ivy cache if I call something like |
|
<artifact name="myApp" type="jar" ext="jar" conf="default"/>
<artifact name="myApp" type="src" ext="jar" conf="sources" e:classifier="src"/> then what I see <artifact name="myApp" type="src" ext="jar" e:classifier="sources"/> and I was baffled by this for a while.
|
|
Sorry for the sudden change of events, but hopefully you can see my point and that this is the recommended way to handle these kinds of artifacts. |
|
Fixed by #1016. |
Currently, sbt resolves "classifiers" (sources and javadocs) by taking the existing
ModuleID
(a sbt class representing a dependency) and creatingsbt.Artifact
s from it (insbt.IvyActions.classifiedArtifacts
) which have thee:classified
set tosources
orjavadoc
(the classifiers themselves come from the settingtransitiveClassifiers :== List(sources, javadoc)
).However I'd argue that this is incorrect:
sources
/javadoc
configs that Ivy will seetransitiveClassifiers
differently for a particular resolver (what if I want them to be "src" and "doc"?) is not possiblemain
, we can see that it mentions exactly what artifact it's publishing under the sources configuration. Thate:classifier
is "sources" here is just a coincidence / convention (it's sbt's default), but that's not necessarily the case everywhere.Thus, I think sbt should make its "Sources" configuration, which corresponds with the ivy
sources
config, depend on thesources
configuration of each dependency (same with javadoc). In a published Ivy file this would look like<dependency ... conf="compile->default(compile);sources;javadoc">
as in, aside from the normal stuff, "our" sources depends on this dep's sources, and our javadoc depends on this dep's javadoc.Only if such artifact/configuration isn't provided in a dependency's ivy file should sbt magically produce an artifact, hoping that the file exists and follows the default pattern.
The text was updated successfully, but these errors were encountered: