use a static logger
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@369113 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
838f2129a8
commit
18c27b8a23
@ -55,7 +55,7 @@ public final class JiraDownloader
|
||||
/**
|
||||
* Log for debug output.
|
||||
*/
|
||||
private static Log log = LogFactory.getLog( JiraDownloader.class );
|
||||
private static final Log LOG = LogFactory.getLog( JiraDownloader.class );
|
||||
|
||||
/** Mapping containing all JIRA status values. */
|
||||
private static Map statusMap = new HashMap();
|
||||
@ -109,16 +109,16 @@ public final class JiraDownloader
|
||||
/** The component to show. */
|
||||
private String component;
|
||||
|
||||
/** The username to log into JIRA. */
|
||||
/** The username to LOG into JIRA. */
|
||||
private String jiraUser;
|
||||
|
||||
/** The password to log into JIRA. */
|
||||
/** The password to LOG into JIRA. */
|
||||
private String jiraPassword;
|
||||
|
||||
/** The username to log into webserver. */
|
||||
/** The username to LOG into webserver. */
|
||||
private String webUser;
|
||||
|
||||
/** The password to log into webserver. */
|
||||
/** The password to LOG into webserver. */
|
||||
private String webPassword;
|
||||
|
||||
/** The maven project. */
|
||||
@ -268,7 +268,7 @@ public final class JiraDownloader
|
||||
jiraUrl = jiraUrl.substring( 0, jiraUrl.lastIndexOf( "/" ) );
|
||||
}
|
||||
|
||||
log.info( "Jira lives at: " + jiraUrl );
|
||||
LOG.info( "Jira lives at: " + jiraUrl );
|
||||
doAuthentication( cl, jiraUrl );
|
||||
|
||||
String projectPage = "";
|
||||
@ -282,17 +282,17 @@ public final class JiraDownloader
|
||||
try
|
||||
{
|
||||
cl.executeMethod( gm );
|
||||
log.info( "Succesfully reached JIRA." );
|
||||
LOG.info( "Succesfully reached JIRA." );
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
if ( log.isDebugEnabled() )
|
||||
if ( LOG.isDebugEnabled() )
|
||||
{
|
||||
log.error( "Unable to reach JIRA project page:", e );
|
||||
LOG.error( "Unable to reach JIRA project page:", e );
|
||||
}
|
||||
else
|
||||
{
|
||||
log.error(
|
||||
LOG.error(
|
||||
"Unable to reach JIRA project page. Cause is: "
|
||||
+ e.getLocalizedMessage() );
|
||||
}
|
||||
@ -303,7 +303,7 @@ public final class JiraDownloader
|
||||
|
||||
if ( id == null )
|
||||
{
|
||||
log.info( "Jira URL " + url
|
||||
LOG.info( "Jira URL " + url
|
||||
+ " doesn't include a pid, trying to get it" );
|
||||
|
||||
int pidIndex = projectPage.indexOf( "pid=" ); // @todo, a safer way to get the PID
|
||||
@ -311,7 +311,7 @@ public final class JiraDownloader
|
||||
if ( pidIndex == -1 )
|
||||
{
|
||||
// fail
|
||||
log.error( "Unable to get JIRA pid using url "
|
||||
LOG.error( "Unable to get JIRA pid using url "
|
||||
+ project.getIssueTrackingUrl() );
|
||||
|
||||
return;
|
||||
@ -342,7 +342,7 @@ public final class JiraDownloader
|
||||
if ( fixforIndex == -1 )
|
||||
{
|
||||
// fail
|
||||
log.error( "Unable to get JIRA roadmap using url "
|
||||
LOG.error( "Unable to get JIRA roadmap using url "
|
||||
+ project.getIssueTrackingUrl() );
|
||||
|
||||
return;
|
||||
@ -373,7 +373,7 @@ public final class JiraDownloader
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
log.error( "Error accessing " + project.getIssueTrackingUrl(), e );
|
||||
LOG.error( "Error accessing " + project.getIssueTrackingUrl(), e );
|
||||
}
|
||||
}
|
||||
|
||||
@ -395,13 +395,13 @@ public final class JiraDownloader
|
||||
Credentials defaultcreds =
|
||||
new UsernamePasswordCredentials( webUser, webPassword );
|
||||
|
||||
log.info( "Using username: " + webUser
|
||||
LOG.info( "Using username: " + webUser
|
||||
+ " for Basic Authentication against the webserver at "
|
||||
+ jiraUrl );
|
||||
client.getState().setCredentials( null, null, defaultcreds );
|
||||
}
|
||||
|
||||
// log into JIRA if we have to
|
||||
// LOG into JIRA if we have to
|
||||
String loginUrl = null;
|
||||
|
||||
if ( ( jiraUser != null ) && ( jiraUser.length() > 0 )
|
||||
@ -411,7 +411,7 @@ public final class JiraDownloader
|
||||
|
||||
loginLink.append( "/login.jsp?os_destination=/secure/" );
|
||||
loginLink.append( "&os_username=" ).append( jiraUser );
|
||||
log.info( "Login URL: " + loginLink + "&os_password=*******" );
|
||||
LOG.info( "Login URL: " + loginLink + "&os_password=*******" );
|
||||
loginLink.append( "&os_password=" ).append( jiraPassword );
|
||||
loginUrl = loginLink.toString();
|
||||
}
|
||||
@ -424,17 +424,17 @@ public final class JiraDownloader
|
||||
try
|
||||
{
|
||||
client.executeMethod( loginGet );
|
||||
log.info( "Succesfully logged in into JIRA." );
|
||||
LOG.info( "Succesfully logged in into JIRA." );
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
if ( log.isDebugEnabled() )
|
||||
if ( LOG.isDebugEnabled() )
|
||||
{
|
||||
log.error( "Error trying to login into JIRA:", e );
|
||||
LOG.error( "Error trying to login into JIRA:", e );
|
||||
}
|
||||
else
|
||||
{
|
||||
log.error( "Error trying to login into JIRA. Cause is: "
|
||||
LOG.error( "Error trying to login into JIRA. Cause is: "
|
||||
+ e.getLocalizedMessage() );
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@ public final class JiraDownloader
|
||||
// see whether there is any proxy defined in maven
|
||||
if ( project == null )
|
||||
{
|
||||
log.error( "No project set. No proxy info available." );
|
||||
LOG.error( "No project set. No proxy info available." );
|
||||
|
||||
return;
|
||||
}
|
||||
@ -463,7 +463,7 @@ public final class JiraDownloader
|
||||
|
||||
if ( ctx == null )
|
||||
{
|
||||
log.error( "Maven project has no context. No proxy info available." );
|
||||
LOG.error( "Maven project has no context. No proxy info available." );
|
||||
|
||||
return;
|
||||
}
|
||||
@ -476,13 +476,13 @@ public final class JiraDownloader
|
||||
|
||||
client.getHostConfiguration().setProxy( proxyHost,
|
||||
Integer.parseInt( proxyPort ) );
|
||||
log.info( "Using proxy: " + proxyHost + " at port " + proxyPort );
|
||||
LOG.info( "Using proxy: " + proxyHost + " at port " + proxyPort );
|
||||
|
||||
String proxyUser = ctx.getProxyUserName();
|
||||
|
||||
if ( proxyUser != null )
|
||||
{
|
||||
log.info( "Using proxy user: " + proxyUser );
|
||||
LOG.info( "Using proxy user: " + proxyUser );
|
||||
|
||||
String proxyPass = ctx.getProxyPassword();
|
||||
|
||||
@ -510,7 +510,7 @@ public final class JiraDownloader
|
||||
{
|
||||
GetMethod gm = new GetMethod( link );
|
||||
|
||||
log.info( "Downloading " + link );
|
||||
LOG.info( "Downloading " + link );
|
||||
gm.setFollowRedirects( true );
|
||||
cl.executeMethod( gm );
|
||||
|
||||
@ -526,7 +526,7 @@ public final class JiraDownloader
|
||||
|
||||
if ( sl == null )
|
||||
{
|
||||
log.info( "Unknown error validating link : " + link );
|
||||
LOG.info( "Unknown error validating link : " + link );
|
||||
|
||||
return;
|
||||
}
|
||||
@ -538,50 +538,50 @@ public final class JiraDownloader
|
||||
|
||||
if ( locationHeader == null )
|
||||
{
|
||||
log.info( "Site sent redirect, but did not set Location header" );
|
||||
LOG.info( "Site sent redirect, but did not set Location header" );
|
||||
}
|
||||
else
|
||||
{
|
||||
String newLink = locationHeader.getValue();
|
||||
|
||||
log.debug( "Following redirect to " + newLink );
|
||||
LOG.debug( "Following redirect to " + newLink );
|
||||
download( cl, newLink, outFile );
|
||||
}
|
||||
}
|
||||
|
||||
if ( gm.getStatusCode() != HttpStatus.SC_OK )
|
||||
{
|
||||
log.warn( "Received: [" + gm.getStatusCode() + "]" );
|
||||
LOG.warn( "Received: [" + gm.getStatusCode() + "]" );
|
||||
}
|
||||
}
|
||||
catch ( HttpException e )
|
||||
{
|
||||
if ( log.isDebugEnabled() )
|
||||
if ( LOG.isDebugEnabled() )
|
||||
{
|
||||
log.error( "Error downloading issues from JIRA:", e );
|
||||
LOG.error( "Error downloading issues from JIRA:", e );
|
||||
}
|
||||
else
|
||||
{
|
||||
log.error( "Error downloading issues from JIRA. Cause is: "
|
||||
LOG.error( "Error downloading issues from JIRA. Cause is: "
|
||||
+ e.getLocalizedMessage() );
|
||||
}
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
if ( log.isDebugEnabled() )
|
||||
if ( LOG.isDebugEnabled() )
|
||||
{
|
||||
log.error( "Error downloading issues from JIRA:", e );
|
||||
LOG.error( "Error downloading issues from JIRA:", e );
|
||||
}
|
||||
else
|
||||
{
|
||||
log.error( "Error downloading issues from JIRA. Cause is: "
|
||||
LOG.error( "Error downloading issues from JIRA. Cause is: "
|
||||
+ e.getLocalizedMessage() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the output file for the log.
|
||||
* Set the output file for the LOG.
|
||||
*
|
||||
* @param thisOutput
|
||||
* the output file
|
||||
@ -669,7 +669,7 @@ public final class JiraDownloader
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password to log into a secured JIRA.
|
||||
* Sets the password to LOG into a secured JIRA.
|
||||
*
|
||||
* @param thisJiraPassword
|
||||
* The password for JIRA
|
||||
@ -680,7 +680,7 @@ public final class JiraDownloader
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the username to log into a secured JIRA.
|
||||
* Sets the username to LOG into a secured JIRA.
|
||||
*
|
||||
* @param thisJiraUser
|
||||
* The username for JIRA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user