hosuaby / inject-resources

Simple and convenient way to read content of resource in Java.
http://inject-resources.hosuaby.io
Apache License 2.0
53 stars 5 forks source link

Improve Maven setup instructions in documentation #5

Closed jkraml closed 3 years ago

jkraml commented 3 years ago

The documentation explains that this project's artefacts are hosted on JCenter and suggests the user add this configuration to their pom:

<repositories>
    <repository>
        ...
        <id>central</id>
        <name>bintray</name>
        <url>https://jcenter.bintray.com</url>
    </repository>
</repositories>

This can lead to unexpected problems in some cases.

By specifying its ID as "central", this repository configuration replaces Maven's default configuration for that ID which points to https://repo.maven.apache.org/maven2. (Generate the effective pom in an empty project with and without the above config to reproduce)

Some users, especially in corporate settings, may have defined a mirror for ID "central" with the default URL. This will cause Maven to try and fetch "inject-resources-..." from https://repo.maven.apache.org/maven2, which will fail.

I suggest changing the documentation. Either use a different ID (e.g. "jcenter") or add a remark like "You may have to define a different repository ID when using a mirror".

hosuaby commented 3 years ago

I released a patch 0.1.1 with updated doc. Thanks for your observation!