Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
maven-embedder-3.8.6.jar - Maven Embedder Module
maven-embedder-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Embedder module. Apache Maven is a software project management and comprehension tool.
JAR File Size and Download Location:
File: 99649 06-06-2022 16:16 lib/maven-embedder-3.8.6.jar Download: Apache Maven Website
✍: FYIcenter.com
⏎ org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
package org.apache.maven.cli.configuration; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.FileNotFoundException; import java.util.List; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; import org.apache.commons.cli.CommandLine; import org.apache.maven.artifact.InvalidRepositoryException; import org.apache.maven.bridge.MavenRepositorySystem; import org.apache.maven.building.Source; import org.apache.maven.cli.CLIManager; import org.apache.maven.cli.CliRequest; import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenExecutionRequestPopulationException; import org.apache.maven.settings.Mirror; import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Repository; import org.apache.maven.settings.Server; import org.apache.maven.settings.Settings; import org.apache.maven.settings.SettingsUtils; import org.apache.maven.settings.building.DefaultSettingsBuildingRequest; import org.apache.maven.settings.building.SettingsBuilder; import org.apache.maven.settings.building.SettingsBuildingRequest; import org.apache.maven.settings.building.SettingsBuildingResult; import org.apache.maven.settings.building.SettingsProblem; import org.apache.maven.settings.crypto.SettingsDecrypter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.apache.maven.cli.ResolveFile.resolveFile; /** * SettingsXmlConfigurationProcessor */ @Named ( SettingsXmlConfigurationProcessor.HINT ) @Singleton public class SettingsXmlConfigurationProcessor implements ConfigurationProcessor { public static final String HINT = "settings"; public static final String USER_HOME = System.getProperty( "user.home" ); public static final File USER_MAVEN_CONFIGURATION_HOME = new File( USER_HOME, ".m2" ); public static final File DEFAULT_USER_SETTINGS_FILE = new File( USER_MAVEN_CONFIGURATION_HOME, "settings.xml" ); public static final File DEFAULT_GLOBAL_SETTINGS_FILE = new File( System.getProperty( "maven.conf" ), "settings.xml" ); private final Logger logger = LoggerFactory.getLogger( SettingsXmlConfigurationProcessor.class ); @Inject private SettingsBuilder settingsBuilder; @Inject private SettingsDecrypter settingsDecrypter; @Override public void process( CliRequest cliRequest ) throws Exception { CommandLine commandLine = cliRequest.getCommandLine(); String workingDirectory = cliRequest.getWorkingDirectory(); MavenExecutionRequest request = cliRequest.getRequest(); File userSettingsFile; if ( commandLine.hasOption( CLIManager.ALTERNATE_USER_SETTINGS ) ) { userSettingsFile = new File( commandLine.getOptionValue( CLIManager.ALTERNATE_USER_SETTINGS ) ); userSettingsFile = resolveFile( userSettingsFile, workingDirectory ); if ( !userSettingsFile.isFile() ) { throw new FileNotFoundException( "The specified user settings file does not exist: " + userSettingsFile ); } } else { userSettingsFile = DEFAULT_USER_SETTINGS_FILE; } File globalSettingsFile; if ( commandLine.hasOption( CLIManager.ALTERNATE_GLOBAL_SETTINGS ) ) { globalSettingsFile = new File( commandLine.getOptionValue( CLIManager.ALTERNATE_GLOBAL_SETTINGS ) ); globalSettingsFile = resolveFile( globalSettingsFile, workingDirectory ); if ( !globalSettingsFile.isFile() ) { throw new FileNotFoundException( "The specified global settings file does not exist: " + globalSettingsFile ); } } else { globalSettingsFile = DEFAULT_GLOBAL_SETTINGS_FILE; } request.setGlobalSettingsFile( globalSettingsFile ); request.setUserSettingsFile( userSettingsFile ); SettingsBuildingRequest settingsRequest = new DefaultSettingsBuildingRequest(); settingsRequest.setGlobalSettingsFile( globalSettingsFile ); settingsRequest.setUserSettingsFile( userSettingsFile ); settingsRequest.setSystemProperties( cliRequest.getSystemProperties() ); settingsRequest.setUserProperties( cliRequest.getUserProperties() ); if ( request.getEventSpyDispatcher() != null ) { request.getEventSpyDispatcher().onEvent( settingsRequest ); } logger.debug( "Reading global settings from {}", getLocation( settingsRequest.getGlobalSettingsSource(), settingsRequest.getGlobalSettingsFile() ) ); logger.debug( "Reading user settings from {}", getLocation( settingsRequest.getUserSettingsSource(), settingsRequest.getUserSettingsFile() ) ); SettingsBuildingResult settingsResult = settingsBuilder.build( settingsRequest ); if ( request.getEventSpyDispatcher() != null ) { request.getEventSpyDispatcher().onEvent( settingsResult ); } populateFromSettings( request, settingsResult.getEffectiveSettings() ); if ( !settingsResult.getProblems().isEmpty() && logger.isWarnEnabled() ) { logger.warn( "" ); logger.warn( "Some problems were encountered while building the effective settings" ); for ( SettingsProblem problem : settingsResult.getProblems() ) { logger.warn( "{} @ {}", problem.getMessage(), problem.getLocation() ); } logger.warn( "" ); } } private MavenExecutionRequest populateFromSettings( MavenExecutionRequest request, Settings settings ) throws MavenExecutionRequestPopulationException { if ( settings == null ) { return request; } request.setOffline( settings.isOffline() ); request.setInteractiveMode( settings.isInteractiveMode() ); request.setPluginGroups( settings.getPluginGroups() ); request.setLocalRepositoryPath( settings.getLocalRepository() ); for ( Server server : settings.getServers() ) { server = server.clone(); request.addServer( server ); } // <proxies> // <proxy> // <active>true</active> // <protocol>http</protocol> // <host>proxy.somewhere.com</host> // <port>8080</port> // <username>proxyuser</username> // <password>somepassword</password> // <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts> // </proxy> // </proxies> for ( Proxy proxy : settings.getProxies() ) { if ( !proxy.isActive() ) { continue; } proxy = proxy.clone(); request.addProxy( proxy ); } // <mirrors> // <mirror> // <id>nexus</id> // <mirrorOf>*</mirrorOf> // <url>http://repository.sonatype.org/content/groups/public</url> // </mirror> // </mirrors> for ( Mirror mirror : settings.getMirrors() ) { mirror = mirror.clone(); request.addMirror( mirror ); } request.setActiveProfiles( settings.getActiveProfiles() ); for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() ) { request.addProfile( SettingsUtils.convertFromSettingsProfile( rawProfile ) ); if ( settings.getActiveProfiles().contains( rawProfile.getId() ) ) { List<Repository> remoteRepositories = rawProfile.getRepositories(); for ( Repository remoteRepository : remoteRepositories ) { try { request.addRemoteRepository( MavenRepositorySystem.buildArtifactRepository( remoteRepository ) ); } catch ( InvalidRepositoryException e ) { // do nothing for now } } List<Repository> pluginRepositories = rawProfile.getPluginRepositories(); for ( Repository pluginRepository : pluginRepositories ) { try { request.addPluginArtifactRepository( MavenRepositorySystem.buildArtifactRepository( pluginRepository ) ); } catch ( InvalidRepositoryException e ) { // do nothing for now } } } } return request; } private Object getLocation( Source source, File defaultLocation ) { if ( source != null ) { return source.getLocation(); } return defaultLocation; } }
⏎ org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
Or download all of them as a single archive file:
File name: maven-embedder-3.8.6-src.zip File size: 57444 bytes Release date: 2022-06-06 Download
⇒ maven-model-3.8.6.jar - Maven Model Module
⇐ maven-compat-3.8.6.jar - Maven Compact Module
2020-10-26, 15174👍, 0💬
Popular Posts:
How to download and install JDK (Java Development Kit) 8? If you want to write Java applications, yo...
What Is commons-lang3-3.1.jar? commons-lang3-3.1.jar is the JAR file for Apache Commons Lang 3.1, wh...
Jaxen, Release 1.1.1, is an open source XPath library written in Java. It is adaptable to many diffe...
A stream buffer is a stream-based representation of an XML infoset in Java. Stream buffers are desig...
The Apache FontBox library is an open source Java tool to obtain low level information from font fil...