Open blackd opened 2 years ago
Yes, thats correct, you can use loom.disableDeprecatedPomGeneration(publishing.publications.mavenJava)
to disable this warning.
The plan is to remove this workaround after the deprecated behavour has been removed, its not ideal but its the best that can be done. (Let me know if you think otherwise?)
You can see a working example of this here: https://github.com/FabricMC/fabric/pull/1802
Let me know if that helps or you have any more issues.
My project structure is:
As you can imagine every subproject in platforms has a publication. However the source artefact is a combination of the sources in common and the version specific stuff and the javadoc artefact comes only from common. So I have to manually define the publication to accommodate the above.
So I would prefer that the deprecated behaviour stays :smile:. May be leave it in but disabled by default.
Of course the other solution will be to recreate what net.fabricmc.loom.configuration.MavenPublication does in my build scripts I haven't read through but I guess it's possible.
Going to CC @Juuxel in here as they made the change.
Im not against leaving the deprecated behaviour in (and removing the message), as its not really wrong but might be hard to maintain?
@blackd The publications in your project tree should be possible with standard software components (components.java
/components["java"]
) afaik:
from zipTree(project(":common").tasks.sourcesJar.archiveFile)
(or something similar) or@modmuss50 It honestly might be fine to have the legacy option in the future, but as opt-in. What I mostly disliked about the old system (apart from the bugs I fixed there too) was that it automatically does changes to publications without being told to. I could imagine there being something like
publishing {
publications {
maven(MavenPublication) { p ->
loom.setupPom p // or a more accurate name if loom does something else too; can't remember right now
// could also be called setupNoComponentPublication or something
}
}}
}
@Juuxel I think I've started without java doc and sources artefacts using from(components.... but something in the generated pom didn't match the requirements for publishing on maven central. TBH since I took over the mod I've spend more time fighting gradle then developing the mod. At some point I just gave up on making the "right" way.
Any way whether it stays or not is up to you guys. In both cases I'll manage 😂
something in the generated pom didn't match the requirements for publishing on maven central
Hmm, it could be that you're missing some metadata (project description, URLs, authors etc) that can be added with gradle's usual API, not sure though
Hi, I'm getting this nice message
Loom is applying dependency data manually to publications instead of using a software component (from(components["java"]))
I've looked at the Loom sources and it makes sense to remove the dependency injection. However I have artefact that is combination from parts build by several subprojects sofrom(components["java"])
is not really a possibility for me.