本文整理了Java中org.apache.maven.settings.Settings.isOffline()
方法的一些代码示例,展示了Settings.isOffline()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Settings.isOffline()
方法的具体详情如下:
包路径:org.apache.maven.settings.Settings
类名称:Settings
方法名:isOffline
[英]Get indicate whether maven should operate in offline mode full-time.
[中]Get指示maven是否应全职在脱机模式下运行。
代码示例来源:origin: apache/maven
if ( settings.isOffline() != false )
serializer.startTag( NAMESPACE, "offline" ).text( String.valueOf( settings.isOffline() ) ).endTag( NAMESPACE, "offline" );
代码示例来源:origin: apache/maven
request.setOffline( settings.isOffline() );
代码示例来源:origin: apache/maven
/**
* @param settings could be null
* @return a new instance of settings or null if settings was null.
*/
public static Settings copySettings( Settings settings )
{
if ( settings == null )
{
return null;
}
Settings clone = new Settings();
clone.setActiveProfiles( settings.getActiveProfiles() );
clone.setInteractiveMode( settings.isInteractiveMode() );
clone.setLocalRepository( settings.getLocalRepository() );
clone.setMirrors( settings.getMirrors() );
clone.setModelEncoding( settings.getModelEncoding() );
clone.setOffline( settings.isOffline() );
clone.setPluginGroups( settings.getPluginGroups() );
clone.setProfiles( settings.getProfiles() );
clone.setProxies( settings.getProxies() );
clone.setServers( settings.getServers() );
clone.setSourceLevel( settings.getSourceLevel() );
clone.setUsePluginRegistry( settings.isUsePluginRegistry() );
return clone;
}
}
代码示例来源:origin: apache/maven
request.setOffline( settings.isOffline() );
代码示例来源:origin: org.apache.maven/maven-settings
if ( settings.isOffline() != false )
serializer.startTag( NAMESPACE, "offline" ).text( String.valueOf( settings.isOffline() ) ).endTag( NAMESPACE, "offline" );
代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven
/**
* Returns whether the resolver should work in offline mode or not,
* If the programmaticOffline hasn't been set yet, the value is taken from a {@link Settings} instance
*
* @return whether the resolver should work in offline mode or not
*/
protected boolean isOffline() {
if (this.programmaticOffline != null) {
return this.programmaticOffline.booleanValue();
}
return this.getSettings().isOffline();
}
代码示例来源:origin: org.twdata.maven/maven-cli-plugin
public PhaseCallRunner(MavenSession session, MavenProject project) {
this.session = session;
this.project = project;
this.userDir = new File(System.getProperty("user.dir"));
this.pluginExecutionOfflineMode = session.getSettings().isOffline();
}
代码示例来源:origin: shrinkwrap/resolver
/**
* Returns whether the resolver should work in offline mode or not,
* If the programmaticOffline hasn't been set yet, the value is taken from a {@link Settings} instance
*
* @return whether the resolver should work in offline mode or not
*/
protected boolean isOffline() {
if (this.programmaticOffline != null) {
return this.programmaticOffline.booleanValue();
}
return this.getSettings().isOffline();
}
代码示例来源:origin: org.kie.soup/kie-soup-maven-integration
public static synchronized Aether getAether() {
if ( instance == null ) {
Settings settings = MavenSettings.getSettings();
instance = new Aether( settings, loadMavenProject( settings.isOffline() ) );
}
return instance;
}
代码示例来源:origin: org.uberfire/uberfire-maven-integration
public static synchronized Aether getAether() {
if ( instance == null ) {
Settings settings = MavenSettings.getSettings();
instance = new Aether( settings, loadMavenProject( settings.isOffline() ) );
}
return instance;
}
代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven
/**
* Gets manager for local repository
*
* @return the manager
*/
public LocalRepositoryManager localRepositoryManager(final RepositorySystemSession session, boolean legacyLocalRepository) {
Validate.notNull(session, "session must be specified");
String localRepositoryPath = settings.getLocalRepository();
Validate.notNullOrEmpty(localRepositoryPath, "Path to a local repository must be defined");
SWRLocalRepositoryManager factory = SWRLocalRepositoryManager.ENHANCED;
// here we rely either on system property or flag passed by caller
if (useLegacyLocalRepository || legacyLocalRepository) {
factory = SWRLocalRepositoryManager.LEGACY;
}
if (settings.isOffline()) {
factory = SWRLocalRepositoryManager.SIMPLE;
}
LocalRepositoryManager manager = factory.localRepositoryManager(system, session, new File(localRepositoryPath));
return manager;
}
代码示例来源:origin: org.kie.soup/kie-soup-maven-integration
private Aether( Settings settings, MavenProject mavenProject ) {
this.localRepoDir = settings.getLocalRepository();
this.offline = settings.isOffline();
system = newRepositorySystem();
session = newRepositorySystemSession( settings, system );
repositories = initRepositories( mavenProject );
}
代码示例来源:origin: shrinkwrap/resolver
/**
* Gets manager for local repository
*
* @return the manager
*/
public LocalRepositoryManager localRepositoryManager(final RepositorySystemSession session, boolean legacyLocalRepository) {
Validate.notNull(session, "session must be specified");
String localRepositoryPath = settings.getLocalRepository();
Validate.notNullOrEmpty(localRepositoryPath, "Path to a local repository must be defined");
SWRLocalRepositoryManager factory = SWRLocalRepositoryManager.ENHANCED;
// here we rely either on system property or flag passed by caller
if (useLegacyLocalRepository || legacyLocalRepository) {
factory = SWRLocalRepositoryManager.LEGACY;
}
if (settings.isOffline()) {
factory = SWRLocalRepositoryManager.SIMPLE;
}
LocalRepositoryManager manager = factory.localRepositoryManager(system, session, new File(localRepositoryPath));
return manager;
}
代码示例来源:origin: org.uberfire/uberfire-maven-integration
private Aether( Settings settings, MavenProject mavenProject ) {
this.localRepoDir = settings.getLocalRepository();
this.offline = settings.isOffline();
system = newRepositorySystem();
session = newRepositorySystemSession( settings, system );
repositories = initRepositories( mavenProject );
}
代码示例来源:origin: spring-cloud/spring-cloud-function
/**
* Create a new {@link MavenSettings} instance.
* @param settings the source settings
* @param decryptedSettings the decrypted settings
*/
public MavenSettings(Settings settings, SettingsDecryptionResult decryptedSettings) {
this.offline = settings.isOffline();
this.mirrorSelector = createMirrorSelector(settings);
this.authenticationSelector = createAuthenticationSelector(decryptedSettings);
this.proxySelector = createProxySelector(decryptedSettings);
this.localRepository = settings.getLocalRepository();
this.activeProfiles = determineActiveProfiles(settings);
}
代码示例来源:origin: org.springframework.boot/spring-boot-cli
/**
* Create a new {@link MavenSettings} instance.
* @param settings the source settings
* @param decryptedSettings the decrypted settings
*/
public MavenSettings(Settings settings, SettingsDecryptionResult decryptedSettings) {
this.offline = settings.isOffline();
this.mirrorSelector = createMirrorSelector(settings);
this.authenticationSelector = createAuthenticationSelector(decryptedSettings);
this.proxySelector = createProxySelector(decryptedSettings);
this.localRepository = settings.getLocalRepository();
this.activeProfiles = determineActiveProfiles(settings);
}
代码示例来源:origin: org.springframework.boot.experimental/spring-boot-thin-launcher
/**
* Create a new {@link MavenSettings} instance.
* @param settings the source settings
* @param decryptedSettings the decrypted settings
*/
public MavenSettings(Settings settings, SettingsDecryptionResult decryptedSettings) {
this.offline = settings.isOffline();
this.mirrorSelector = createMirrorSelector(settings);
this.authenticationSelector = createAuthenticationSelector(decryptedSettings);
this.proxySelector = createProxySelector(decryptedSettings);
this.localRepository = settings.getLocalRepository();
this.activeProfiles = determineActiveProfiles(settings);
}
代码示例来源:origin: org.codehaus.mevenide/nb-mvn-embedder
/**
* Method updateSettings
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateSettings(Settings value, String xmlTag, Counter counter, Element element)
{
Element root = element;
Counter innerCount = new Counter(counter.getDepth() + 1);
findAndReplaceSimpleElement(innerCount, root, "localRepository", value.getLocalRepository(), null);
findAndReplaceSimpleElement(innerCount, root, "interactiveMode", value.isInteractiveMode() == true ? null : String.valueOf( value.isInteractiveMode() ), "true");
findAndReplaceSimpleElement(innerCount, root, "usePluginRegistry", value.isUsePluginRegistry() == false ? null : String.valueOf( value.isUsePluginRegistry() ), "false");
findAndReplaceSimpleElement(innerCount, root, "offline", value.isOffline() == false ? null : String.valueOf( value.isOffline() ), "false");
iterateProxy(innerCount, root, value.getProxies(),"proxies","proxy");
iterateServer(innerCount, root, value.getServers(),"servers","server");
iterateMirror(innerCount, root, value.getMirrors(),"mirrors","mirror");
iterateProfile(innerCount, root, value.getProfiles(),"profiles","profile");
findAndReplaceSimpleLists(innerCount, root, value.getActiveProfiles(), "activeProfiles", "activeProfile");
findAndReplaceSimpleLists(innerCount, root, value.getPluginGroups(), "pluginGroups", "pluginGroup");
} //-- void updateSettings(Settings, String, Counter, Element)
代码示例来源:origin: org.jboss.galleon/galleon-cli
MavenMvnSettings(MavenConfig config, RepositorySystem repoSystem, RepositoryListener listener) throws ArtifactException {
Settings settings = buildMavenSettings(config.getSettings());
repositories = Collections.unmodifiableList(buildRemoteRepositories(settings));
Proxy proxy = settings.getActiveProxy();
MavenProxySelector proxySelector = null;
if (proxy != null) {
MavenProxySelector.Builder builder = new MavenProxySelector.Builder(proxy.getHost(), proxy.getPort(), proxy.getProtocol());
builder.setPassword(proxy.getPassword());
builder.setUserName(proxy.getUsername());
if (proxy.getNonProxyHosts() != null) {
String[] hosts = proxy.getNonProxyHosts().split("\\|");
builder.addNonProxyHosts(Arrays.asList(hosts));
}
proxySelector = builder.build();
}
session = Util.newRepositorySession(repoSystem,
settings.getLocalRepository() == null ? config.getLocalRepository() : Paths.get(settings.getLocalRepository()),
listener, proxySelector, settings.isOffline());
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-maven-embedder
/**
* Method updateSettings.
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateSettings(Settings value, String xmlTag, Counter counter, Element element)
{
Element root = element;
Counter innerCount = new Counter(counter.getDepth() + 1);
findAndReplaceSimpleElement(innerCount, root, "localRepository", value.getLocalRepository(), null);
findAndReplaceSimpleElement(innerCount, root, "interactiveMode", value.isInteractiveMode() == true ? null : String.valueOf( value.isInteractiveMode() ), "true");
findAndReplaceSimpleElement(innerCount, root, "usePluginRegistry", value.isUsePluginRegistry() == false ? null : String.valueOf( value.isUsePluginRegistry() ), "false");
findAndReplaceSimpleElement(innerCount, root, "offline", value.isOffline() == false ? null : String.valueOf( value.isOffline() ), "false");
iterateProxy(innerCount, root, value.getProxies(),"proxies","proxy");
iterateServer(innerCount, root, value.getServers(),"servers","server");
iterateMirror(innerCount, root, value.getMirrors(),"mirrors","mirror");
iterateProfile(innerCount, root, value.getProfiles(),"profiles","profile");
findAndReplaceSimpleLists(innerCount, root, value.getActiveProfiles(), "activeProfiles", "activeProfile");
findAndReplaceSimpleLists(innerCount, root, value.getPluginGroups(), "pluginGroups", "pluginGroup");
} //-- void updateSettings(Settings, String, Counter, Element)
内容来源于网络,如有侵权,请联系作者删除!