CptBartender commented on code in PR #2979:
URL: https://github.com/apache/karaf/pull/2979#discussion_r4206362563
##########
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:
Please consider extracting the 2d arrays as static constants
```suggestion
private static final String[][] OPTIONS = {
{ ENHANCED_LOCAL_REPOSITORY + "split",
ServiceConstants.OPTION_SPLIT },
{ ENHANCED_LOCAL_REPOSITORY + "splitLocal",
ServiceConstants.OPTION_SPLIT_LOCAL },
{ ENHANCED_LOCAL_REPOSITORY + "splitRemote",
ServiceConstants.OPTION_SPLIT_REMOTE },
{ ENHANCED_LOCAL_REPOSITORY + "splitRemoteRepository",
ServiceConstants.OPTION_SPLIT_REMOTE_REPOSITORY },
{ ENHANCED_LOCAL_REPOSITORY + "splitRemoteRepositoryLast",
ServiceConstants.OPTION_SPLIT_REMOTE_REPOSITORY_LAST }
};
private static final String[][] PREFIXES = {
{ ENHANCED_LOCAL_REPOSITORY + "localPrefix",
ServiceConstants.OPTION_SPLIT_LOCAL_PREFIX },
{ ENHANCED_LOCAL_REPOSITORY + "remotePrefix",
ServiceConstants.OPTION_SPLIT_REMOTE_PREFIX },
{ ENHANCED_LOCAL_REPOSITORY + "releasesPrefix",
ServiceConstants.OPTION_SPLIT_RELEASES_PREFIX },
{ ENHANCED_LOCAL_REPOSITORY + "snapshotsPrefix",
ServiceConstants.OPTION_SPLIT_SNAPSHOTS_PREFIX }
};
```
With this, we wouldn't have to concat the strings each time
`#getPaxUrlLocalRepository` is called.
--
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]