本文整理匯總了Java中org.apache.maven.plugin.logging.Log.warn方法的典型用法代碼示例。如果您正苦於以下問題:Java Log.warn方法的具體用法?Java Log.warn怎麽用?Java Log.warn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.maven.plugin.logging.Log
的用法示例。
在下文中一共展示了Log.warn方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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();
}
示例2: sendGetCommand
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
* sendGetCommand
*
* @param url
* @param log
* @return
* @throws MojoExecutionException
* @throws CheckException
*/
public Map<String, String> sendGetCommand( String url, Log log )
throws CheckException
{
Map<String, String> response = new HashMap<String, String>();
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpget = new HttpGet( url );
try
{
CloseableHttpResponse httpResponse = httpclient.execute( httpget, localContext );
ResponseHandler<String> handler = new ResponseErrorHandler();
String body = handler.handleResponse( httpResponse );
response.put( "body", body );
httpResponse.close();
}
catch ( Exception e )
{
log.warn( "GET request failed!" );
throw new CheckException( "Send GET to server failed!", e );
}
return response;
}
示例3: buildDockerInfoJar
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
@Nonnull
protected File buildDockerInfoJar(@Nonnull Log log) throws MojoExecutionException {
final File jarFile = getJarFile(buildDirectory, finalName, classifier);
final MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver(jarArchiver);
archiver.setOutputFile(jarFile);
archive.setForced(forceCreation);
if (dockerInfoDirectory.exists()) {
final String prefix = getMetaSubdir();
archiver.getArchiver().addDirectory(dockerInfoDirectory, prefix);
} else {
log.warn("Docker info directory not created - Docker info JAR will be empty");
}
try {
archiver.createArchive(session, project, archive);
} catch (Exception e) {
throw new MojoExecutionException("Could not build Docker info JAR", e);
}
return jarFile;
}
示例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: 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;
}
}
示例6: sendPostCommand
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
/**
* @param url
* @param parameters
* @return
* @throws MojoExecutionException
* @throws CheckException
*/
public Map<String, Object> sendPostCommand( String url, Map<String, String> parameters, Log log )
throws CheckException
{
Map<String, Object> response = new HashMap<String, Object>();
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost( url );
httpPost.setHeader( "Accept", "application/json" );
httpPost.setHeader( "Content-type", "application/json" );
try
{
ObjectMapper mapper = new ObjectMapper();
StringEntity entity = new StringEntity( mapper.writeValueAsString( parameters ) );
httpPost.setEntity( entity );
CloseableHttpResponse httpResponse = httpclient.execute( httpPost, localContext );
ResponseHandler<String> handler = new ResponseErrorHandler();
String body = handler.handleResponse( httpResponse );
response.put( "body", body );
httpResponse.close();
}
catch ( Exception e )
{
log.warn( "POST request failed!" );
throw new CheckException( "Send POST to server failed!", e );
}
return response;
}
示例7: execute
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
@Override
public void execute(DockerClient dockerClient)
throws MojoExecutionException, MojoFailureException {
final Log log = getLog();
if (skipBuild) {
log.info("Skipping execution because 'dockerfile.build.skip' is set");
return;
}
final String imageId = buildImage(
dockerClient, log, verbose, contextDirectory, repository, tag, pullNewerImage, noCache,
buildArgs);
if (imageId == null) {
log.warn("Docker build was successful, but no image was built");
} else {
log.info(MessageFormat.format("Detected build of image with id {0}", imageId));
writeMetadata(Metadata.IMAGE_ID, imageId);
}
// Do this after the build so that other goals don't use the tag if it doesn't exist
if (repository != null) {
writeImageInfo(repository, tag);
}
writeMetadata(log);
if (repository == null) {
log.info(MessageFormat.format("Successfully built {0}", imageId));
} else {
log.info(MessageFormat.format("Successfully built {0}", formatImageName(repository, tag)));
}
}
示例8: JavaVersionResolver
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public JavaVersionResolver(MavenSession session, LifecycleExecutor lifecycleExecutor, Log log) {
this.session = session;
this.log = log;
this.mojoExecutions = new LinkedList<>();
try {
this.mojoExecutions = lifecycleExecutor.calculateExecutionPlan(session, true, COMPILE_GOAL).getMojoExecutions();
} catch (Exception e) {
log.warn(String.format("Failed to get mojo executions for goal '%s': %s", COMPILE_GOAL, e.getMessage()));
}
}
示例9: cleanDataDir
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public synchronized void cleanDataDir(Log log) {
if(canDeleteDataDir) {
clean(log, dataDir);
}
else {
log.warn("Can't delete data dir: " + dataDir + " - content was already existing");
}
}
示例10: cleanConfDir
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public synchronized void cleanConfDir(Log log) {
if(canDeleteConfDir) {
clean(log, confDir);
}
else {
log.warn("Can't delete conf dir: " + confDir + " - content was already existing");
}
}
示例11: execute
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public void execute() throws MojoExecutionException {
Log log = getLog();
if (configServerPort == null) {
configServerPort = 19071;
}
if (!applicationFile.exists() || !applicationFile.canRead()) {
log.warn("Cannot find or read '" + applicationFile + "', skipping");
} else {
log.info("Using application zip file '" + applicationFile + "'");
deploy(applicationFile, log);
}
}
示例12: execute
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public void execute() throws MojoExecutionException, MojoFailureException {
final Log log = getLog();
if (!integrationTestVerifyEnabled) {
log.debug("Disabled, skipping");
return;
}
final File file = new File(buildDir, DotnetIntegrationTestRunMojo.RESULT_FILENAME);
if (file.exists()) {
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
String line = reader.readLine();
if (DotnetIntegrationTestRunMojo.RESULT_VALUE_SUCCESS.equals(line)) {
// everything OK
return;
}
while (line != null) {
log.warn(line);
line = reader.readLine();
}
} catch (Exception e) {
throw new MojoExecutionException("Could not read from " + file, e);
}
}
// error out with generic message (if successful we should have return'ed earlier)
throw new MojoFailureException("Dotnet integration tests failed");
}
示例13: logWarnBaseProblem
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public static void logWarnBaseProblem(Log log, String[] messages) {
log.warn("");
log.warn("\tBASE PROBLEM:");
for (String message : messages)
{
log.warn("\t" + message);
}
}
示例14: logWarnInstructions
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public static void logWarnInstructions(Log log, String[] messages) {
log.warn("");
log.warn("\tINSTRUCTIONS:");
for (String message : messages)
{
log.warn("\t" + message);
}
log.warn("");
}
示例15: logWarnExample
import org.apache.maven.plugin.logging.Log; //導入方法依賴的package包/類
public static void logWarnExample(Log log, String[] messages) {
log.warn("");
log.warn("\tEXAMPLE:");
for (String message : messages)
{
log.warn("\t" + message);
}
log.warn("");
}