Re: [CHANGES PLUGIN] 'webUser' is ignored for JIRA report

2014-03-26 Thread Behrooz Nobakht
Thanks for the hint. Unfortunately, it's still the same:

---
ID: 2
Address: https://MYJIRA.COM/issuetracker/rest/api/2/status
Http-Method: GET
Content-Type: */*
Headers: {Accept=[application/json], Content-Type=[*/*],
Cookie=[$Version=1;
atlassian.xsrf.token=AMUY-0X4J-KTOA-WYA4|cc7d64910370a05f29ed98695aaa41c6cde9584c|lout;
$Path=/issuetracker]}
--
[DEBUG] Accept: application/json
[DEBUG] Content-Type: */*
[DEBUG] Cookie: $Version=1;
atlassian.xsrf.token=AMUY-0X4J-KTOA-WYA4|cc7d64910370a05f29ed98695aaa41c6cde9584c|lout;
$Path=/issuetracker
[DEBUG] No Trust Decider for Conduit
'{https://MYJIRA.COM/issuetracker}WebClient.http-conduit'. An
afirmative Trust Decision is assumed.
[DEBUG] Response Code: 200 Conduit:
{https://MYJIRA.COM/issuetracker}WebClient.http-conduit
[DEBUG] Content length: -1
[DEBUG] Header fields:
null: [HTTP/1.1 200 OK]
Transfer-Encoding: [chunked]
Date: [Wed, 26 Mar 2014 07:45:04 GMT]
Keep-Alive: [timeout=15, max=99]
Via: [1.1 MYJIRA.COM]
Connection: [Keep-Alive]
Content-Type: [application/json;charset=UTF-8]
X-AUSERNAME: [anonymous]
X-AREQUESTID: [525x34612x1]
Server: [Apache-Coyote/1.1]
Cache-Control: [no-cache, no-store, no-transform]

[DEBUG] Adding interceptor
org.apache.cxf.interceptor.LoggingInInterceptor@568653d9 to phase
receive
[DEBUG] Chain org.apache.cxf.phase.PhaseInterceptorChain@75d46202 was
created. Current flow:
  receive [LoggingInInterceptor]

[DEBUG] Invoking handleMessage on interceptor
org.apache.cxf.interceptor.LoggingInInterceptor@568653d9
[INFO] Inbound Message

ID: 2
Response-Code: 200
Encoding: UTF-8
Content-Type: application/json;charset=UTF-8
Headers: {Cache-Control=[no-cache, no-store, no-transform],
connection=[Keep-Alive],
content-type=[application/json;charset=UTF-8], Date=[Wed, 26 Mar 2014
07:45:04 GMT], Keep-Alive=[timeout=15, max=99],
Server=[Apache-Coyote/1.1], transfer-encoding=[chunked], Via=[1.1
MYJIRA.COM], X-AREQUESTID=[525x34612x1], X-AUSERNAME=[anonymous]}
Payload: []
--
[WARNING]
org.apache.maven.plugin.MojoFailureException: Could not find status Closed.
at 
org.apache.maven.plugin.jira.RestJiraDownloader.resolveOneItem(RestJiraDownloader.java:263)
at 
org.apache.maven.plugin.jira.RestJiraDownloader.resolveList(RestJiraDownloader.java:244)
at 
org.apache.maven.plugin.jira.RestJiraDownloader.resolveIds(RestJiraDownloader.java:209)
at 
org.apache.maven.plugin.jira.RestJiraDownloader.doExecute(RestJiraDownloader.java:131)



On Tue, Mar 25, 2014 at 5:49 PM, Dennis Lundberg denn...@apache.org wrote:

 Hi,

 Please try the latest 2.10-SNAPSHOT version of the plugin.
 It has a fix for an issue that sounds similar to yours.

 On Mon, Mar 24, 2014 at 10:11 AM, Behrooz N nob...@gmail.com wrote:
  Hello,
 
  I want to generate a JIRA report using Changes Plugin. I've managed to
  re-produce a situation which is contradictory:
 
 1. I use Maven and POM to generate the JIRA report.
 2. I checkout 2.9 source and use a JUnit test class to verify.
 
  In case (1), the following Maven configuration is used:
 
  reporting
  plugins
  plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-changes-plugin/artifactId
  version2.9/version
  configuration
  useJqltrue/useJql
  onlyCurrentVersiontrue/onlyCurrentVersion
  statusIdsClosed,Resolved/statusIds
  webUserUSER/webUser
  webPasswordPASS/webPassword
  /configuration
  /plugin
  /plugins
  /reporting
 
  Then using mvn -X changes:jira-report, I get the following:
 
  ---
  ID: 2
  Address: https://MYJIRA.COM/issuetracker/rest/api/2/status
  Http-Method: GET
  Content-Type: */*
  Headers: {Accept=[application/json], Content-Type=[*/*]}
  --
  [DEBUG] Accept: application/json
  [DEBUG] Content-Type: */*
  [DEBUG] No Trust Decider for Conduit
  '{https://MYJIRA.COM/issuetracker}WebClient.http-conduit'. An
  afirmative Trust Decision is assumed.
  [DEBUG] Response Code: 200 Conduit:
  {https://MYJIRA.COM/issuetracker}WebClient.http-conduit
  [DEBUG] Content length: -1
  [DEBUG] Header fields:
  null: [HTTP/1.1 200 OK]
  Transfer-Encoding: [chunked]
  Date: [Mon, 24 Mar 2014 08:23:14 GMT]
  Keep-Alive: [timeout=15, max=99]
  Via: [1.1 MYJIRA.COM]
  Set-Cookie:
 
 [atlassian.xsrf.token=AMUY-0X4J-KTOA-WYA4|faf5142cf78de245e3573fc6cd122b41d1a0fe8e|lout;
  Path=/issuetracker]
  Connection: [Keep-Alive]
  Content-Type: [application/json;charset=UTF-8]
  X-AUSERNAME: [anonymous]
  X-AREQUESTID: [563x130866x1]
  Server: [Apache-Coyote/1.1]
  Cache-Control: [no-cache, no-store, no-transform]
 

Re: [CHANGES PLUGIN] 'webUser' is ignored for JIRA report

2014-03-25 Thread Dennis Lundberg
Hi,

Please try the latest 2.10-SNAPSHOT version of the plugin.
It has a fix for an issue that sounds similar to yours.

On Mon, Mar 24, 2014 at 10:11 AM, Behrooz N nob...@gmail.com wrote:
 Hello,

 I want to generate a JIRA report using Changes Plugin. I've managed to
 re-produce a situation which is contradictory:

1. I use Maven and POM to generate the JIRA report.
2. I checkout 2.9 source and use a JUnit test class to verify.

 In case (1), the following Maven configuration is used:

 reporting
 plugins
 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-changes-plugin/artifactId
 version2.9/version
 configuration
 useJqltrue/useJql
 onlyCurrentVersiontrue/onlyCurrentVersion
 statusIdsClosed,Resolved/statusIds
 webUserUSER/webUser
 webPasswordPASS/webPassword
 /configuration
 /plugin
 /plugins
 /reporting

 Then using mvn -X changes:jira-report, I get the following:

 ---
 ID: 2
 Address: https://MYJIRA.COM/issuetracker/rest/api/2/status
 Http-Method: GET
 Content-Type: */*
 Headers: {Accept=[application/json], Content-Type=[*/*]}
 --
 [DEBUG] Accept: application/json
 [DEBUG] Content-Type: */*
 [DEBUG] No Trust Decider for Conduit
 '{https://MYJIRA.COM/issuetracker}WebClient.http-conduit'. An
 afirmative Trust Decision is assumed.
 [DEBUG] Response Code: 200 Conduit:
 {https://MYJIRA.COM/issuetracker}WebClient.http-conduit
 [DEBUG] Content length: -1
 [DEBUG] Header fields:
 null: [HTTP/1.1 200 OK]
 Transfer-Encoding: [chunked]
 Date: [Mon, 24 Mar 2014 08:23:14 GMT]
 Keep-Alive: [timeout=15, max=99]
 Via: [1.1 MYJIRA.COM]
 Set-Cookie:
 [atlassian.xsrf.token=AMUY-0X4J-KTOA-WYA4|faf5142cf78de245e3573fc6cd122b41d1a0fe8e|lout;
 Path=/issuetracker]
 Connection: [Keep-Alive]
 Content-Type: [application/json;charset=UTF-8]
 X-AUSERNAME: [anonymous]
 X-AREQUESTID: [563x130866x1]
 Server: [Apache-Coyote/1.1]
 Cache-Control: [no-cache, no-store, no-transform]

 [DEBUG] Adding interceptor
 org.apache.cxf.interceptor.LoggingInInterceptor@5af3a14 to phase
 receive
 [DEBUG] Chain org.apache.cxf.phase.PhaseInterceptorChain@574e6595 was
 created. Current flow:
   receive [LoggingInInterceptor]

 [DEBUG] Invoking handleMessage on interceptor
 org.apache.cxf.interceptor.LoggingInInterceptor@5af3a14
 [INFO] Inbound Message
 
 ID: 2
 Response-Code: 200
 Encoding: UTF-8
 Content-Type: application/json;charset=UTF-8
 Headers: {Cache-Control=[no-cache, no-store, no-transform],
 connection=[Keep-Alive],
 content-type=[application/json;charset=UTF-8], Date=[Mon, 24 Mar 2014
 08:23:14 GMT], Keep-Alive=[timeout=15, max=99],
 Server=[Apache-Coyote/1.1],
 Set-Cookie=[atlassian.xsrf.token=AMUY-0X4J-KTOA-WYA4|faf5142cf78de245e3573fc6cd122b41d1a0fe8e|lout;
 Path=/issuetracker], transfer-encoding=[chunked], Via=[1.1
 MYJIRA.COM], X-AREQUESTID=[563x130866x1], X-AUSERNAME=[anonymous]}
 Payload: []

 In the above note that HTTPS is used, result Payload is empty and webUser
 is *ignored* (as anonymous) and Authorization Header is missing.
 Additionally, Maven ends with the following exception which makes sense
 based on the code:

 org.apache.maven.plugin.MojoFailureException: Could not find status Closed.
 at 
 org.apache.maven.plugin.jira.RestJiraDownloader.resolveOneItem(RestJiraDownloader.java:276)
 at 
 org.apache.maven.plugin.jira.RestJiraDownloader.resolveList(RestJiraDownloader.java:253)
 at 
 org.apache.maven.plugin.jira.RestJiraDownloader.resolveIds(RestJiraDownloader.java:210)
 at 
 org.apache.maven.plugin.jira.RestJiraDownloader.doExecute(RestJiraDownloader.java:128)
 at 
 org.apache.maven.plugin.jira.AdaptiveJiraDownloader.doExecute(AdaptiveJiraDownloader.java:47)
 at org.apache.maven.plugin.jira.JiraMojo.executeReport(JiraMojo.java:367)
 at 
 org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)

 In case (2), the source for the plugin version 2.9 is checked out. A simple
 unit test is written to simulate the same configuration:

 RestJiraDownloader d = new RestJiraDownloader();
 Log log = new DefaultLog(new ConsoleLogger(Logger.LEVEL_DEBUG, 
 test));
 d.setLog(log);
 d.project = new MavenProject();
 d.project.setIssueManagement(new IssueManagement());
 d.project.getIssueManagement().setUrl(
 https://MYJIRA.COM/issuetracker/browse/CSP;);
 d.project.getIssueManagement().setSystem(JIRA);
 d.setWebUser(USER);
 d.setWebPassword(PASS);
 d.setUseJql(true);
 d.setStatusIds(Resolved,Closed);

 MapString, String params = JiraHelper
 

[CHANGES PLUGIN] 'webUser' is ignored for JIRA report

2014-03-24 Thread Behrooz N
Hello,

I want to generate a JIRA report using Changes Plugin. I've managed to
re-produce a situation which is contradictory:

   1. I use Maven and POM to generate the JIRA report.
   2. I checkout 2.9 source and use a JUnit test class to verify.

In case (1), the following Maven configuration is used:

reporting
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-changes-plugin/artifactId
version2.9/version
configuration
useJqltrue/useJql
onlyCurrentVersiontrue/onlyCurrentVersion
statusIdsClosed,Resolved/statusIds
webUserUSER/webUser
webPasswordPASS/webPassword
/configuration
/plugin
/plugins
/reporting

Then using mvn -X changes:jira-report, I get the following:

---
ID: 2
Address: https://MYJIRA.COM/issuetracker/rest/api/2/status
Http-Method: GET
Content-Type: */*
Headers: {Accept=[application/json], Content-Type=[*/*]}
--
[DEBUG] Accept: application/json
[DEBUG] Content-Type: */*
[DEBUG] No Trust Decider for Conduit
'{https://MYJIRA.COM/issuetracker}WebClient.http-conduit'. An
afirmative Trust Decision is assumed.
[DEBUG] Response Code: 200 Conduit:
{https://MYJIRA.COM/issuetracker}WebClient.http-conduit
[DEBUG] Content length: -1
[DEBUG] Header fields:
null: [HTTP/1.1 200 OK]
Transfer-Encoding: [chunked]
Date: [Mon, 24 Mar 2014 08:23:14 GMT]
Keep-Alive: [timeout=15, max=99]
Via: [1.1 MYJIRA.COM]
Set-Cookie:
[atlassian.xsrf.token=AMUY-0X4J-KTOA-WYA4|faf5142cf78de245e3573fc6cd122b41d1a0fe8e|lout;
Path=/issuetracker]
Connection: [Keep-Alive]
Content-Type: [application/json;charset=UTF-8]
X-AUSERNAME: [anonymous]
X-AREQUESTID: [563x130866x1]
Server: [Apache-Coyote/1.1]
Cache-Control: [no-cache, no-store, no-transform]

[DEBUG] Adding interceptor
org.apache.cxf.interceptor.LoggingInInterceptor@5af3a14 to phase
receive
[DEBUG] Chain org.apache.cxf.phase.PhaseInterceptorChain@574e6595 was
created. Current flow:
  receive [LoggingInInterceptor]

[DEBUG] Invoking handleMessage on interceptor
org.apache.cxf.interceptor.LoggingInInterceptor@5af3a14
[INFO] Inbound Message

ID: 2
Response-Code: 200
Encoding: UTF-8
Content-Type: application/json;charset=UTF-8
Headers: {Cache-Control=[no-cache, no-store, no-transform],
connection=[Keep-Alive],
content-type=[application/json;charset=UTF-8], Date=[Mon, 24 Mar 2014
08:23:14 GMT], Keep-Alive=[timeout=15, max=99],
Server=[Apache-Coyote/1.1],
Set-Cookie=[atlassian.xsrf.token=AMUY-0X4J-KTOA-WYA4|faf5142cf78de245e3573fc6cd122b41d1a0fe8e|lout;
Path=/issuetracker], transfer-encoding=[chunked], Via=[1.1
MYJIRA.COM], X-AREQUESTID=[563x130866x1], X-AUSERNAME=[anonymous]}
Payload: []

In the above note that HTTPS is used, result Payload is empty and webUser
is *ignored* (as anonymous) and Authorization Header is missing.
Additionally, Maven ends with the following exception which makes sense
based on the code:

org.apache.maven.plugin.MojoFailureException: Could not find status Closed.
at 
org.apache.maven.plugin.jira.RestJiraDownloader.resolveOneItem(RestJiraDownloader.java:276)
at 
org.apache.maven.plugin.jira.RestJiraDownloader.resolveList(RestJiraDownloader.java:253)
at 
org.apache.maven.plugin.jira.RestJiraDownloader.resolveIds(RestJiraDownloader.java:210)
at 
org.apache.maven.plugin.jira.RestJiraDownloader.doExecute(RestJiraDownloader.java:128)
at 
org.apache.maven.plugin.jira.AdaptiveJiraDownloader.doExecute(AdaptiveJiraDownloader.java:47)
at org.apache.maven.plugin.jira.JiraMojo.executeReport(JiraMojo.java:367)
at 
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)

In case (2), the source for the plugin version 2.9 is checked out. A simple
unit test is written to simulate the same configuration:

RestJiraDownloader d = new RestJiraDownloader();
Log log = new DefaultLog(new ConsoleLogger(Logger.LEVEL_DEBUG, test));
d.setLog(log);
d.project = new MavenProject();
d.project.setIssueManagement(new IssueManagement());
d.project.getIssueManagement().setUrl(
https://MYJIRA.COM/issuetracker/browse/CSP;);
d.project.getIssueManagement().setSystem(JIRA);
d.setWebUser(USER);
d.setWebPassword(PASS);
d.setUseJql(true);
d.setStatusIds(Resolved,Closed);

MapString, String params = JiraHelper
.getJiraUrlAndProjectName(d.project.getIssueManagement()
.getUrl());
String jiraUrl = params.get(url);
String project = params.get(project);
System.out.println(JIRA:  + jiraUrl +   | project:  + project);

Thread.currentThread().setContextClassLoader(