I am trying to publish an API to a `maven repo` us...
# community-support
s
I am trying to publish an API to a
maven repo
using
maven-publish
. I have unfortunately only gotten it to work if you specify a specific classifier. I can get it by specifying that it's a
@jar
as that seems to be the problem here. Here is the `build.gradle.kts`: https://github.com/UndefinedCreation/Stellar. Does anyone know what I'm doing wrong here? Thanks in advance.
t
It's not clear what you're trying to publish: the root project (that doesn't contain any code, but is probably what you published) or the "api" project (that depends on all the other projects, so they'd have to be published too) ? Also, try to avoid
allproject{}
, prefer creating convention plugins that you apply to each project that needs it.
☝️ 1
Also, don't tweak the artifactId in the publication or you'll have mismatches between the dependencies on that project declared in other projects (they'll use the project name as artifactId) and the actual artifact being published. To change a project's name, do it in the settings script (this will also change how you reference that project in the build scripts).
1
☝️ 1
Wrt your problem, it's probably due to the fact that the POM (and Gradle metadata) declare a (circular) dependency on itself.
s
@Thomas Broyer Thanks for the help. My expertise on Gradle is quite short, so I'll explain what I want included. This API needs the user to be able to interact with api, and as of all of the other modules, api uses them, but the user doesn't directly interact with them (apart from the common module), so I think it needs them, but I'm not entirely sure. Furthermore, I will start to use convention plugins. And about the answer you gave for why you thought this happens, do you mean that, for example, I'm implementing both the api and the common modules, and that api already implements common, thus a circular dependency on itself?
@Thomas Broyer I just saw you reactions... Again, I'm not great at this. I'm publishing whatever is in the project as a whole right now, and it works, it just, from what I can understand, can't identify it's a
.jar
project. Are you saying I should publish the "api" module? If so, then I should modify that
build.gradle.kts
to implement the other modules right?