Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* $Id: org/arakhne/maven/AetherBridge.java v12.0 2015-04-09 01:25:33$
*
* Copyright (C) 2010-12 Stephane GALLAND This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* This program is free software; you can redistribute it and/or modify
*/
package org.arakhne.maven;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.repository.RepositorySystem;
/**
* Provide a bridge for compatibility
* between the Sonatype and Eclipse implementations
* of Aether.
*
* @author Stéphane GALLAND
* @version 12.0 2015-04-09 01:25:33
* @mavengroupid org.arakhne.afc.maven
* @mavenartifactid maventools
* @deprecated
*/
@Deprecated
class AetherBridge {
/** Indicates if the current implementation of the
* Aether API in from Eclipse (if true),
* or from Sonatype (if false).
*/
public static final boolean IS_ECLIPSE_API;
static {
boolean isEclipse;
try {
Class.forName("org.eclipse.aether.artifact.DefaultArtifact"); //$NON-NLS-1$
isEclipse = true;
}
catch(Throwable _) {
isEclipse = false;
}
IS_ECLIPSE_API = isEclipse;
}
/**
*/
private AetherBridge() {
Logger.getAnonymousLogger().info("AETHER API: " + (IS_ECLIPSE_API ? "Eclipse" : "Sonatype")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
private static T newInstance(String classname, Class instanceType, Object... parameters) throws MojoExecutionException {
try {
Class> type = Class.forName(classname);
Class>[] formalParameters = Arrays.copyOfRange(
parameters, 0, parameters.length/2, Class[].class);
Object[] realParameters = Arrays.