本文整理汇总了Java中org.apache.maven.plugin.logging.Log.debug方法的典型用法代码示例。如果您正苦于以下问题:Java Log.debug方法的具体用法?Java Log.debug怎么用?Java Log.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.plugin.logging.Log
的用法示例。
在下文中一共展示了Log.debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLibrary
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
/**
* @param projectDirectory the (workspace) directory containing the project
* @param log logger to be used if debugging information should be produced
* @return true if the project is an IIB Application
* @throws MojoFailureException if something went wrong
*/
public static boolean isLibrary(File projectDirectory, Log log) throws MojoFailureException {
try
{
if (projectDirectory.getName().equalsIgnoreCase("BARFiles")) {
return false;
}
List<String> natureList = getProjectDescription(projectDirectory).getNatures().getNature();
if (natureList
.contains("com.ibm.etools.msgbroker.tooling.libraryNature")) {
log.debug(projectDirectory + " is an IIB Library");
return true;
} else {
return false;
}
} catch (Exception e)
{
String message = "An error occurred trying to determine the nature of the eclipse project at " + projectDirectory.getAbsolutePath() + ".";
message += "\n" + "The error was: " + e;
message += "\n" + "Instead of allowing the build to fail, the EclipseProjectUtils.isLibrary() method is returning false";
log.warn(message);
return false;
}
}
示例2: testLog
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
public void testLog()
{
Log log = new DependencySilentLog();
String text = new String( "Text" );
Throwable e = new RuntimeException();
log.debug( text );
log.debug( text, e );
log.debug( e );
log.info( text );
log.info( text, e );
log.info( e );
log.warn( text );
log.warn( text, e );
log.warn( e );
log.error( text );
log.error( text, e );
log.error( e );
log.isDebugEnabled();
log.isErrorEnabled();
log.isWarnEnabled();
log.isInfoEnabled();
}
示例3: haveResourcesChanged
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
public static boolean haveResourcesChanged(Log log, MavenProject project, BuildContext buildContext, String suffix) {
String baseDir = project.getBasedir().getAbsolutePath();
for (Resource r : project.getBuild().getResources()) {
File file = new File(r.getDirectory());
if (file.isAbsolute()) {
file = new File(r.getDirectory().substring(baseDir.length() + 1));
}
String path = file.getPath() + "/" + suffix;
log.debug("checking if " + path + " (" + r.getDirectory() + "/" + suffix + ") has changed.");
if (buildContext.hasDelta(path)) {
log.debug("Indeed " + suffix + " has changed.");
return true;
}
}
return false;
}
示例4: delete
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
/**
* Deletes a file or a directory
*
* If the directory is not empty, it'll delete all files and sub-dirs before
*
* @param log Maven logger to use
* @param path of the file
*/
public static void delete(Log log, Path path) {
if (log != null && path != null) {
try {
if (Files.isDirectory(path)) {
Files.walkFileTree(path, new Deleter(log));
}
else if (Files.isWritable(path)) {
Files.deleteIfExists(path);
}
}
catch (IOException e) {
log.warn("Can't delete " + path.toAbsolutePath() + " - "+ e.getMessage() + " (will try on exit)");
log.debug(e);
}
}
}
示例5: downloadHttpResource
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
private boolean downloadHttpResource(Log log, String remote, File local) throws MojoExecutionException {
local.getParentFile().mkdirs();
InputStream stream = null;
CloseableHttpClient httpclient = HttpClients.custom().disableContentCompression().build();
try {
HttpEntity entity = httpclient.execute(new HttpGet(remote)).getEntity();
if (entity != null) {
stream = entity.getContent();
Files.copy(stream, local.toPath());
return true;
}
} catch (Exception exception) {
if (log.isDebugEnabled()) {
log.debug("Error downloading resource [" + remote + "]", exception);
}
} finally {
IOUtils.closeQuietly(stream);
IOUtils.closeQuietly(httpclient);
}
return false;
}
示例6: getClassLoader
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
/**
* Provides a class loader that can be used to load classes from this
* project classpath.
*
* @param project
* the maven project currently being built
* @param parent
* a classloader which should be used as the parent of the newly
* created classloader.
* @param log
* object to which details of the found/loaded classpath elements
* can be logged.
*
* @return a classloader that can be used to load any class that is
* contained in the set of artifacts that this project classpath is
* based on.
* @throws DependencyResolutionRequiredException
* if maven encounters a problem resolving project dependencies
*/
public ClassLoader getClassLoader(MavenProject project, final ClassLoader parent, Log log) throws DependencyResolutionRequiredException {
@SuppressWarnings("unchecked")
List<String> classpathElements = project.getCompileClasspathElements();
final List<URL> classpathUrls = new ArrayList<URL>(classpathElements.size());
for (String classpathElement : classpathElements) {
try {
log.debug("Adding project artifact to classpath: " + classpathElement);
classpathUrls.add(new File(classpathElement).toURI().toURL());
} catch (MalformedURLException e) {
log.debug("Unable to use classpath entry as it could not be understood as a valid URL: " + classpathElement, e);
}
}
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
public ClassLoader run() {
return new URLClassLoader(classpathUrls.toArray(new URL[classpathUrls.size()]), parent);
}
});
}
示例7: expandProjects
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
@Override
public Set<MavenProject> expandProjects ( final Collection<MavenProject> projects, final Log log, final MavenSession session )
{
try
{
final Set<MavenProject> result = new HashSet<MavenProject> ();
final Queue<MavenProject> queue = new LinkedList<MavenProject> ( projects );
while ( !queue.isEmpty () )
{
final MavenProject project = queue.poll ();
log.debug ( "Checking project: " + project );
if ( project.getFile () == null )
{
log.info ( "Skipping non-local project: " + project );
continue;
}
if ( !result.add ( project ) )
{
// if the project was already in our result, there is no need to process twice
continue;
}
// add all children to the queue
queue.addAll ( loadChildren ( project, log, session ) );
if ( hasLocalParent ( project ) )
{
// if we have a parent, add the parent as well
queue.add ( project.getParent () );
}
}
return result;
}
catch ( final Exception e )
{
throw new RuntimeException ( e );
}
}
示例8: execute
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
public int execute(@Nullable String customCommand, @Nonnull final Log logger, @Nonnull final File cvsFolder, @Nonnull @MustNotContainNull final String... args) {
final List<String> cli = new ArrayList<>();
cli.add(GetUtils.findFirstNonNull(customCommand, this.command));
for (final String s : args) {
cli.add(s);
}
if (logger.isDebugEnabled()) {
logger.debug("Executing repo command : " + cli);
}
final ByteArrayOutputStream errorStream = new ByteArrayOutputStream();
final ByteArrayOutputStream outStream = new ByteArrayOutputStream();
final ProcessExecutor executor = new ProcessExecutor(cli);
int result = -1;
try {
final ProcessResult processResult = executor.directory(cvsFolder).redirectError(errorStream).redirectOutput(outStream).executeNoTimeout();
result = processResult.getExitValue();
if (logger.isDebugEnabled()) {
logger.debug("Exec.out.........................................");
logger.debug(new String(errorStream.toByteArray(), Charset.defaultCharset()));
logger.debug(".................................................");
}
if (result != 0) {
logger.error(new String(errorStream.toByteArray(), Charset.defaultCharset()));
}
} catch (Exception ex) {
logger.error("Unexpected error", ex);
}
return result;
}
示例9: isApplication
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
/**
* @param projectDirectory the (workspace) directory containing the project
* @param log logger to be used if debugging information should be produced
* @return true if the project is an IIB Application
* @throws MojoFailureException if something went wrong
*/
public static boolean isApplication(File projectDirectory, Log log) throws MojoFailureException {
try
{
if (projectDirectory.getName().equalsIgnoreCase("BARFiles")) {
return false;
}
List<String> natureList = getProjectDescription(projectDirectory).getNatures().getNature();
if (natureList
.contains("com.ibm.etools.msgbroker.tooling.applicationNature")) {
log.debug(
projectDirectory + " is an IIB Application");
return true;
} else {
return false;
}
} catch (Exception e)
{
String message = "An error occurred trying to determine the nature of the eclipse project at " + projectDirectory.getAbsolutePath() + ".";
message += "\n" + "The error was: " + e;
message += "\n" + "Instead of allowing the build to fail, the EclipseProjectUtils.isApplication() method is returning false";
log.warn(message);
return false;
}
}
示例10: HttpClient
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
/**
* Create a new client instance
*
* @param host gateway host
* @param port gateway port
*/
public HttpClient(String host, int port, Log log) {
this.host = host;
this.port = port;
this.log = log;
this.urlPrefix = "http://" + host + ":" + port;
this.userAgent = getClass().getSimpleName() + "/" + "1.0";
log.debug("Set user agent string to '" + userAgent + "'");
}
示例11: createCollection
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
/**
* Creates a collection
*
* @param log maven log
* @param colName collection name to create
* @throws MojoExecutionException Exception
*/
public synchronized void createCollection(Log log, String colName) throws MojoExecutionException {
log.debug("About to create collection " + colName);
try {
solrCloud.createCollection(colName, 1, 1, configName, null);
}
catch (SolrServerException | IOException e) {
throw new MojoExecutionException("Can't create solr collection " + colName, e);
}
log.debug("Collection " + colName + " created");
}
示例12: upToBranch
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
private boolean upToBranch(@Nonnull final Log logger, @Nullable final ProxySettings proxy, @Nullable final String customCommand, @Nonnull final File cvsFolder, @Nonnull final String branchId) {
logger.debug("upToBranch: " + branchId);
return checkResult(logger, execute(customCommand, logger, cvsFolder, "update", "--clean", branchId));
}
示例13: upToTag
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
private boolean upToTag(@Nonnull final Log logger, @Nullable final ProxySettings proxy, @Nullable final String customCommand, @Nonnull final File cvsFolder, @Nonnull final String tagId) {
logger.debug("upToTag: " + tagId);
return checkResult(logger, execute(customCommand, logger, cvsFolder, "update", "--clean", tagId));
}
示例14: upToRevision
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
private boolean upToRevision(@Nonnull final Log logger, @Nullable final ProxySettings proxy, @Nullable final String customCommand, @Nonnull final File cvsFolder, @Nonnull final String revisionId) {
logger.debug("upToRevision: " + revisionId);
return checkResult(logger, execute(customCommand, logger, cvsFolder, "update", "--clean", "--rev", revisionId));
}
示例15: upToBranch
import org.apache.maven.plugin.logging.Log; //导入方法依赖的package包/类
private boolean upToBranch(@Nonnull final Log logger, @Nullable final ProxySettings proxy, @Nullable final String customCommand, @Nonnull final File cvsFolder, @Nonnull final String branchId) {
logger.debug("upToBranch : " + branchId);
return checkResult(logger, execute(customCommand, logger, cvsFolder, "switch", "--force", branchId));
}