override maven .m2 local repository system property added
MODIFY
common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java
common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java
@@ -98,6 +98,12 @@ public class PluginUtils {
* @return user's M2 repo
*/
public static File getUserM2Repository() {
+ // if there is m2override system propery, use it.
+ String m2Override = System.getProperty("apiman.gateway.m2-repository-path"); //$NON-NLS-1$
+ if (m2Override != null) {
+ return new File(m2Override).getAbsoluteFile();
+ }
+
String userHome = System.getProperty("user.home"); //$NON-NLS-1$
if (userHome != null) {
File userHomeDir = new File(userHome);

MODIFY
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultPluginRegistry.java
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultPluginRegistry.java
@@ -237,10 +237,6 @@ public class DefaultPluginRegistry implements IPluginRegistry {
// registry first though)
if (!handled) {
File m2Dir = PluginUtils.getUserM2Repository();
- String m2Override = System.getProperty("apiman.gateway.m2-repository-path"); //$NON-NLS-1$
- if (m2Override != null) {
- m2Dir = new File(m2Override).getAbsoluteFile();
- }
if (m2Dir != null) {
File artifactFile = PluginUtils.getM2Path(m2Dir, coordinates);
if (artifactFile.isFile()) {

APIMAN-1235: override maven .m2 local repository system property added (#533)