This message was deleted.
# community-support
s
This message was deleted.
v
What do you do in your buildscript for that to happen?
s
Main project - in build.gradle I have below -- publishing { publications { mavenJava(MavenPublication) { groupId group version version artifactId project.name from components.java PomRegistration(pom) artifacts = [createPackage] } } }
v
Ah, I see. Yeah, the
artifacts =
causes this, in combination with the
from components.java
. You first configure to publish the
java
component, but then manipulate the published artifacts manually, setting it to your
zip
and thus cause the inconsistent state it complains about.
Most often, you should not configure artifacts of a publication manually, but change an existing component or create a new component that is then published.
Maybe you could also just remove the
from
line and it might work, but even then it would at least be questionable.
🙌 1
Btw. setting group, version, and artifact id on the publication is also pointless, those are the defaults anyway and in almost all cases keeping the defaults is anyway better here.
If you remove the
from
line no Gradle Module Metadata is created anyway as only properly defined software components are supported with it. But in your case you probably anyway don't need it.
You are probably coming from a Gradle version where the Gradle Module Metadata was not published by default and thus you did not get this error.
s
after removing from components.java - artifacts got published
However currently dependencies are missing in .pom file
@Vampire could you please advise here
we are having artifacts as zip file, which contains .db, .awl, .udt code
v
Of course dependencies are missing. You now just told Gradle to publish an artifact and not anymore a component. As I said, instead of configuring the publication artifacts manually, properly model the component to be published, either by adapting the existing component if appropriate, or by creating a new component you then publish.