Coder Social home page Coder Social logo

netcentric / maven-ext-repos-from-env Goto Github PK

View Code? Open in Web Editor NEW
1.0 7.0 1.0 107 KB

Allows to auto-configure maven repositories from system environment

License: Eclipse Public License 2.0

Java 100.00%
aem adobe-experience-manager cloud-manager

maven-ext-repos-from-env's Issues

Circumvent mirrors defined in the settings.xml

Currently all repositories are overridden by a mirror defined in the settings.xml. To ease usage with custom settings.xml and bypass its mirror it should optionally be possible to exclude the repository ids used in the extension from the defined mirrors.

This should be feasible by calling https://maven.apache.org/ref/3.6.3/maven-settings/apidocs/org/apache/maven/settings/Mirror.html#setMirrorOf-java.lang.String- with a modified value according to https://maven.apache.org/guides/mini/guide-mirror-settings.html#advanced-mirror-specification

Clarify documentation on implicit file repositories

The readme currently states

In case the relevant environment variables are not set, this extension has no effect.

This is wrong for the implicit file repository .mvn/repository which is always added even if no environment variables are set.
Either the documentation needs to be fixed or the implementation needs to adhere to the documentation (the latter probably requires an additional flag to be able to enable the implicit file repository only).

Allow to parameterize the server id for POM repositories

In case of POM repositories only the credentials are being maintained in the settings.xml. In order to support that use case better it would be helpful to optionally allow to parameterize the server id (as it must match the repository id from the pom.xml). In such a case the repository URL doesn't need to be populated obviously (because it is contained in the POM repository).

Avoid warning when using implicit file repository in .mvn/repository

[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.corp.assets:corp-assets-root:pom:2.0.0-SNAPSHOT
[WARNING] 'repositories.repository.id' must not contain any of these characters \/:"<>|?* but found /
[WARNING] 'pluginRepositories.pluginRepository.id' must not contain any of these characters \/:"<>|?* but found /
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 

Improve logging

It should always be logged on INFO level that an additional remote repository has been added (

logger.debug("Repository from system env: " + repoFromEnv.getUrl() + " (id: "+repoFromEnv.getId()
)

In addition some more debug logs would be helpful which expose

  1. that not all necessary environment variables are set (which ones?)
  2. which remote repositories are already considered (https://maven.apache.org/ref/3.3.9/maven-core/apidocs/org/apache/maven/execution/MavenExecutionRequest.html#getRemoteRepositories()) to be able to detect duplicate remote repo URLs
  3. which mirrors are currently configured (https://maven.apache.org/ref/3.3.9/maven-core/apidocs/org/apache/maven/execution/MavenExecutionRequest.html#getMirrors()) as mirror may prevent the feature from working IMHO

Keep original maven repository as primary repository

thanks for this extension, it works very well! however, in my observation registering a private repository increased the duration of the "Build & Unit Testing" step in cloud manager by a magnitude (from <10 minutes to nearly 40 minutes).

the reason seems to be that now everything is downloaded from the private maven repository. and as the cloud manager does keep a local maven repository with release artifacts already download between execution steps (unlike e.g. travis where the cache can be used for this), it downloads the "whole internet" (tons of maven artifacts) on each run.

did you try to register the private repository as a secondary maven repository, so the primary source for downloading is still the adobe-configured repository, and the private repository is only used as fallback? is this possible with this extensions?

Support for file urls

File urls are generally supported for maven repositories: https://maven.apache.org/guides/introduction/introduction-to-repositories.html#internal-repositories

Using file urls with artifacts provided in git repo itself can be useful, especially if it is only about parent poms. The big advantage is that

  • No remote repository on the internet has to be maintained
  • It can also be used for development team members that don't have access to such a repository

For the case the directory .mvn/repository exists in project structure (similar path as ~/.m2/repository), it should automatically be registered as repository. For other location a URL like file://${maven.multiModuleProjectDirectory}/artifacts/vendor1 or file://${maven.multiModuleProjectDirectory}/artifacts/vendor2 shall be supported (automatically replacing ${maven.multiModuleProjectDirectory} with the reactor root.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.