jbonofre commented on code in PR #2979:
URL: https://github.com/apache/karaf/pull/2979#discussion_r4238265375


##########
tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/utils/MojoSupport.java:
##########
@@ -52,10 +52,16 @@
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.settings.Proxy;
 import org.codehaus.plexus.PlexusContainer;
+import org.ops4j.pax.url.mvn.ServiceConstants;
 
 @SuppressWarnings({"deprecation", "rawtypes", "unchecked"})
 public abstract class MojoSupport extends AbstractMojo {
 
+    /**
+     * Prefix of the Maven resolver (1.9+) configuration properties for the 
split local repository.
+     */
+    private static final String ENHANCED_LOCAL_REPOSITORY = 
"aether.enhancedLocalRepository.";
+

Review Comment:
   Thanks for the review @CptBartender. Agreed, extracting the tables to static 
constants makes `getPaxUrlLocalRepository` easier to read.
   
   @ponziani you call if you wanna apply it? One caveat: the suggested keys 
already include `ENHANCED_LOCAL_REPOSITORY`, so the loops need to look them up 
directly with `configProperties.get(option[0])` and 
`configProperties.get(prefix[0])`. Otherwise the prefix gets applied twice and 
no option matches. `testLocalRepositoryWithSplit` should catch that if it's 
missed.
   
   Since the order of the generated options (`@split@splitLocal@...`) is 
asserted in the tests, please keep the declaration order. If you would rather 
not expose mutable arrays, an ordered immutable structure such as a `List` of 
pairs or a `LinkedHashMap` wrapped in `Collections.unmodifiableMap` works too.
   
   Also, the test already covers `splitLocalPrefix` and `splitSnapshotsPrefix`, 
so only `remotePrefix` and `releasePrefix` are missing. Adding those to 
`testLocalRepositoryWithSplit` while you are in there would close that gap.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to