repaint-io / maven-tiles

Injecting maven configurations by composition rather than inheritance
154 stars 32 forks source link

load tile from repositories declared in pom / settings instead of always from central #88

Closed bvella closed 5 years ago

bvella commented 5 years ago

Extracted from #84. Fixes #85

bvella commented 5 years ago

Is there anything else you need to merge this PR?

talios commented 5 years ago

@bvella I don't think so, altho "instead of always from central" - did it really only look at central? Even tho we were pulling in the session.remoteRepositories?

I'll take a closer look tonight and merge it, altho I'll be in the middle of packing for a music festival/long weekend, so the merge may not happen til I return.

bvella commented 5 years ago

@talios I can only speak from what I observed in debugging, as I'm no expert on maven internals, but session.remoteRepositories seemed to only have central in it. Any repository defined in either settings.xml or the pom files was not available there. The workaround for this for us, before this patch, was to include a mirror for central, like so:

<mirror> 
    <id>private-repo</id>
    <url>https://url.of.private.repo</url>
    <mirrorOf>central</mirrorOf>
</mirror> 

I did not manage to find a way to get our private repo to be included in session.remoteRepositories to load tiles from it, which led me to believe that any repo defined in the project or settings is merged to the project model, hence why using project.remoteArtifactRepositories solved the problem.

Merge in your own time. I just wanted some feedback as to whether you're fine with the pr.

talios commented 5 years ago

@bvella if a mirror is specified - that still gets used yes?

bvella commented 5 years ago

Yes, the mirror config works as expected