Skip to content

Commit

Permalink
[PAXURL-242] Merge MavenConstants into ServiceConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
hwellmann committed Mar 11, 2014
1 parent 3f87e83 commit d56d081
Show file tree
Hide file tree
Showing 10 changed files with 400 additions and 432 deletions.
Expand Up @@ -29,9 +29,114 @@ public interface ServiceConstants
/**
* Service PID used for configuration.
*/
static final String PID = "org.ops4j.pax.url.mvn";
String PID = "org.ops4j.pax.url.mvn";

/**
* The protocol name.
*/
static final String PROTOCOL = "mvn";
String PROTOCOL = "mvn";

/**
* Warning: use only in framework properties. If present, do not accept configuration, wait for one without this flag.
*/
String REQUIRE_CONFIG_ADMIN_CONFIG = ".requireConfigAdminConfig";

/**
* Add the default local repo (e.g. ~/.m2/repository) as a remote repo. Useful when setting the local repo to be e.g. karaf system repo.
* BE CAREFUL! if you are using mirrors, do not mirror local repos! e.g. use <mirrorOf>external:*</mirrorOf>
*/
String PROPERTY_LOCAL_REPO_AS_REMOTE = ".defaultLocalRepoAsRemote";

/**
* Global update policy property name.
* <p>
* Provides <a href="http://maven.apache.org/settings.html">repository update policy</a> which
* will be applied to all configured repositories.
* <p>
* See <a href=
* "http://sonatype.github.com/sonatype-aether/apidocs/org/sonatype/aether/util/DefaultRepositorySystemSession.html#setUpdatePolicy%28java.lang.String%29"
* >DefaultRepositorySystemSession</a>
*/
String PROPERTY_GLOBAL_UPDATE_POLICY = ".globalUpdatePolicy";

/**
* Certificate check configuration property name.
*/
String PROPERTY_CERTIFICATE_CHECK = ".certificateCheck";

/**
* Maven settings file configuration property name.
*/
String PROPERTY_SETTINGS_FILE = ".settings";

/**
* LocalRepository configuration property name.
*/
String PROPERTY_LOCAL_REPOSITORY = ".localRepository";

/**
* DefaultRepositories configuration property name
*/
String PROPERTY_DEFAULT_REPOSITORIES = ".defaultRepositories";

/**
* Repositories configuration property name.
*/
String PROPERTY_REPOSITORIES = ".repositories";

/**
* Use fallback repositories switch configuration property name.
*/
String PROPERTY_USE_FALLBACK_REPOSITORIES = ".useFallbackRepositories";

/**
* Proxy support configuration property name.
*/
String PROPERTY_PROXY_SUPPORT = ".proxySupport";

String PROPERTY_SECURITY = ".security";

/**
* Option to mark repository as allowing snapshots.
*/
String OPTION_ALLOW_SNAPSHOTS = "snapshots";

/**
* Option to configure the default timeout; use a default timeout of
* 5 secs by default.
*/
String PROPERTY_TIMEOUT = ".timeout";

/**
* Option to mark repository as not allowing releases.
*/
String OPTION_DISALLOW_RELEASES = "noreleases";

/**
* Option to mark path as a parent directory of repo directories.
* So at runtime the parent directory is scanned for subdirectories
* and each subdirectory is used as a remote repo
*/
String OPTION_MULTI = "multi";

/**
* Options separator in repository url.
*/
String SEPARATOR_OPTIONS = "@";

/**
* Proxies given via property.
* Expected layout: http:host=foo,port=8080;https:host=bar,port=9090
*/
String PROPERTY_PROXIES = ".proxies";

/**
* Default enable proxies or not if property PROPERTY_PROXY_SUPPORT is not set at all.
*/
boolean PROPERTY_PROXY_SUPPORT_DEFAULT = true;

/**
* segment in repository spec that gives the name of the repo. Crucial for Aether handler.
*/
String OPTION_ID = "id";
}
Expand Up @@ -30,7 +30,6 @@
import org.ops4j.pax.url.mvn.ServiceConstants;
import org.ops4j.pax.url.mvn.internal.config.MavenConfiguration;
import org.ops4j.pax.url.mvn.internal.config.MavenConfigurationImpl;
import org.ops4j.pax.url.mvn.internal.config.MavenConstants;
import org.ops4j.pax.url.mvn.internal.config.MavenRepositoryURL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -102,7 +101,7 @@ public Connection( final URL url, final MavenConfiguration configuration )
if ( repoUrl != null )
{
MavenConfigurationImpl config = (MavenConfigurationImpl) configuration;
config.set( ServiceConstants.PID + MavenConstants.PROPERTY_REPOSITORIES, Arrays.asList( repoUrl ) );
config.set( ServiceConstants.PID + ServiceConstants.PROPERTY_REPOSITORIES, Arrays.asList( repoUrl ) );
}
m_aetherBasedResolver = new AetherBasedResolver( configuration );
}
Expand Down

0 comments on commit d56d081

Please sign in to comment.