@Test public void overrideRepo() throws Exception { System.setProperty("openejb.deployer.repository", "https: final String url = resolver.quickMvnUrl("!junit/junit/4.12/jar"); assertEquals("https: System.clearProperty("openejb.deployer.repository"); }
public String quickMvnUrl(final String raw) throws MalformedURLException { final String base; if (raw.contains(SNAPSHOT_SUFFIX) && raw.contains("apache")) { base = System.getProperty("openejb.deployer.snapshot.repository", APACHE_SNAPSHOT); } else { base = System.getProperty("openejb.deployer.repository", REPO1); } final StringBuilder builder = new StringBuilder(); final String toParse; if (!raw.contains("!")) { final File file = new File(m2Home() + mvnArtifactPath(raw, null)); if (file.exists()) { return file.getAbsolutePath(); } toParse = raw; } else { final int repoIdx = raw.lastIndexOf('!'); toParse = raw.substring(repoIdx + 1); } builder.append(mvnArtifactPath(toParse, base)); return builder.toString(); }
MavenResolver implements ArchiveResolver, ProvisioningResolverAware { public String quickMvnUrl(final String raw) throws MalformedURLException { final String base; if (raw.contains(SNAPSHOT_SUFFIX) && raw.contains("apache")) { base = System.getProperty("openejb.deployer.snapshot.repository", APACHE_SNAPSHOT); } else { base = System.getProperty("openejb.deployer.repository", REPO1); } final StringBuilder builder = new StringBuilder(); final String toParse; if (!raw.contains("!")) { final File file = new File(m2Home() + mvnArtifactPath(raw, null)); if (file.exists()) { return file.getAbsolutePath(); } toParse = raw; } else { final int repoIdx = raw.lastIndexOf('!'); toParse = raw.substring(repoIdx + 1); } builder.append(mvnArtifactPath(toParse, base)); return builder.toString(); } }
MavenResolver implements ArchiveResolver, ProvisioningResolverAware { public String quickMvnUrl(final String raw) throws MalformedURLException { final String base; if (raw.contains(SNAPSHOT_SUFFIX) && raw.contains("apache")) { base = System.getProperty("openejb.deployer.snapshot.repository", APACHE_SNAPSHOT); } else { base = System.getProperty("openejb.deployer.repository", REPO1); } final StringBuilder builder = new StringBuilder(); final String toParse; if (!raw.contains("!")) { final File file = new File(m2Home() + mvnArtifactPath(raw, null)); if (file.exists()) { return file.getAbsolutePath(); } toParse = raw; } else { final int repoIdx = raw.lastIndexOf('!'); toParse = raw.substring(repoIdx + 1); } builder.append(mvnArtifactPath(toParse, base)); return builder.toString(); }  }
MavenResolver implements ArchiveResolver, ProvisioningResolverAware { public String quickMvnUrl(final String raw) throws MalformedURLException { final String base; if (raw.contains(SNAPSHOT_SUFFIX) && raw.contains("apache")) { base = System.getProperty("openejb.deployer.snapshot.repository", APACHE_SNAPSHOT); } else { base = System.getProperty("openejb.deployer.repository", REPO1); } final StringBuilder builder = new StringBuilder(); final String toParse; if (!raw.contains("!")) { final File file = new File(m2Home() + mvnArtifactPath(raw, null)); if (file.exists()) { return file.getAbsolutePath(); } toParse = raw; } else { final int repoIdx = raw.lastIndexOf('!'); toParse = raw.substring(repoIdx + 1); } builder.append(mvnArtifactPath(toParse, base)); return builder.toString(); }  @Override String prefix(); @Override InputStream resolve(final String url); @Override String name(final String rawLocation); String quickMvnUrl(final String raw); @Override void setResolver(final ProvisioningResolver resolver); @Override String toString(); }
MavenResolver implements ArchiveResolver, ProvisioningResolverAware { public String quickMvnUrl(final String raw) throws MalformedURLException { final String base; if (raw.contains(SNAPSHOT_SUFFIX) && raw.contains("apache")) { base = System.getProperty("openejb.deployer.snapshot.repository", APACHE_SNAPSHOT); } else { base = System.getProperty("openejb.deployer.repository", REPO1); } final StringBuilder builder = new StringBuilder(); final String toParse; if (!raw.contains("!")) { final File file = new File(m2Home() + mvnArtifactPath(raw, null)); if (file.exists()) { return file.getAbsolutePath(); } toParse = raw; } else { final int repoIdx = raw.lastIndexOf('!'); toParse = raw.substring(repoIdx + 1); } builder.append(mvnArtifactPath(toParse, base)); return builder.toString(); }  @Override String prefix(); @Override InputStream resolve(final String url); @Override String name(final String rawLocation); String quickMvnUrl(final String raw); @Override void setResolver(final ProvisioningResolver resolver); @Override String toString();  }