How to influence the POM example on mvnrepository.com?

Could you please help my case, @Vampire ?

I publish a library which is intended to be used only in testing (e.g. like the AssertJ, though mine is not nearly as famous :))) And I want that my library is published with scope test, of course.

Currently, at mvnrepository.com it shows up like

<!-- https://mvnrepository.com/artifact/io.github.neboskreb/suppress-logs -->
<dependency>
    <groupId>io.github.neboskreb</groupId>
    <artifactId>suppress-logs</artifactId>
    <version>1.0.6</version>
</dependency>

and I want that it show up like

<!-- https://mvnrepository.com/artifact/io.github.neboskreb/suppress-logs -->
<dependency>
    <groupId>io.github.neboskreb</groupId>
    <artifactId>suppress-logs</artifactId>
    <version>1.0.6</version>
    <scope>test</scope>
</dependency>

How can I specify this in my Gradle files so a proper pom.xml and .module are generated?

I probably can, but that’s no reason to be rude.
Pinging or DMing a person just because you think they could have an answer is rude in practically any open community out there, unless some written rules allow it, or you really want something personal from that person.

Also, the thread you posted to has nothing to do with what you posted, as the thread was about the scope in the POM of your library, so better use a new thread.

What you are asking to is not a Gradle question at all though.
You cannot influence what is displayed there, as it is not coming from your library.
The page mvnrepository.com knits this snippet and displays it.
If there is a way to influence that, I have no idea how.
You have to ask the folks at mvnrepository.com whether this can be influenced, but I doubt it.

A consumer of your library has the choice to which scope they add your library.

Sorry if that felt rude, it was none of my intentions. I have struggled with my question for a while, and you seemed to know this matter very well - that’s why I tagged you. My apologies for the disturbance. I appreciate that you separated my question into its own thread. Thanks!

Indeed, the “published scope” thing is not part of pom.xml; still, somehow mvnrepository.com shows JUnit and the likes with <scope>test</scope>. However, such addition is NOT displayed for the same library at Maven Central. Looks like you’re right - apparently mvnrepository.com manually tags them as “testing libraries”.

This SO answer seems to confirm this.

I find this matter important because of the high influence of mvnrepository.com. Essentially, it is “a google for artifacts”. Most developers just paste those snippets straight into their pom/Gradle files, thus risking adding to the production build a library intended for testing only! In the worst case it might bring a security vulnerability - something which I never want to incur to my users.

Unfortunately, there is no documentation or procedure at mvnrepository.com how to request to tag my library as “for testing”, at least not that I could find… Anyone has idea?

Write to their contact e-mail and ask, and then let us know here what you were told? :slight_smile: