apache / apache/maven-changes-plugin

[MCHANGES-394] statusIds default value not overidden by pom.xml configuration.

Open
#264 0 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
15
Forks
22
Avg merge
8h 1m
Merged PRs (30d)
3

Description

**[Patrice Rochemont](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=prochemo)** opened **[MCHANGES-394](https://issues.apache.org/jira/browse/MCHANGES-394?redirect=false)** and commented

Hi, 
Even if the statusIds are changed in the configuration section of the plugin, le statusIds variable is still "Closed" : resulting in : 

 

```java
[WARNING]
org.apache.maven.plugin.MojoFailureException: Could not find status Closed.
at org.apache.maven.plugin.jira.RestJiraDownloader.resolveOneItem (RestJiraDownloader.java:275)
at org.apache.maven.plugin.jira.RestJiraDownloader.resolveList (RestJiraDownloader.java:256)
at org.apache.maven.plugin.jira.RestJiraDownloader.resolveIds (RestJiraDownloader.java:221)
at org.apache.maven.plugin.jira.RestJiraDownloader.doExecute (RestJiraDownloader.java:141)
at org.apache.maven.plugin.jira.AdaptiveJiraDownloader.doExecute (AdaptiveJiraDownloader.java:45)
at org.apache.maven.plugin.jira.JiraMojo.executeReport (JiraMojo.java:346)
at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:255)
at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:210)
at org.apache.maven.plugin.changes.AbstractChangesReport.execute (AbstractChangesReport.java:203)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[DEBUG] addRuleSet() with no namespace URI
[DEBUG] setDocumentLocator(org.apache.xerces.parsers.AbstractSAXParser$LocatorProxy@44eb2452)
[DEBUG] startDocument()
[DEBUG] startElement(,,tools)
[DEBUG] Pushing body text ''
[DEBUG] New match='tools'
[DEBUG] Fire begin() for SetPropertiesRule[]
[DEBUG] [SetPropertiesRule]{tools} Set org.apache.velocity.tools.config.XmlFactoryConfiguration properties
[DEBUG] BeanUtils.populate(

```

 

with a configuration section  like; 

```java

true

%URL%/issues/%ISSUE%

false
Fix Version,Key,Summary,Type,Resolution,Status

Key DESC,Type,Fix Version DESC

1,10101

6,10003

project = MP102ICNXNET_BLM AND status in (CLOSED, FINISHED)
CDIS V
500

...

```

This following method call is performed when the client retrieve all status with /jira2/rest/api/2/status and the items is empty 

 

```java

private String resolveOneItem( JsonNode items, String what, String nameOrId )
throws IOException, MojoExecutionException, MojoFailureException
{
for ( int cx = 0; cx < items.size(); cx++ )
{
JsonNode item = items.get( cx );
if ( nameOrId.equals( item.get( "id" ).asText() ) )
{
return nameOrId;
}
else if ( nameOrId.equals( item.get( "name" ).asText() ) )
{
return item.get( "id" ).asText();
}
}
throw new MojoFailureException( String.format( "Could not find %s %s.", what, nameOrId ) );
}
```

 

Thus, the jira-report.xml generated is empty :( 

Best regards.

 

---

**Affects:** 2.12.1

Contributor guide

No contributing guide indexed for this repository

Research direction

Read RestJiraDownloader.resolveOneItem and trace how statusIds is populated from the plugin's ; compare that value with the default "Closed". Reproduce report generation with the shown statusIds and inspect the generated jira-report.xml; done means the configured IDs are used and the report is no longer empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.