Bug 826386 - [mvn] Glossary-push compendium PO file: failed to run if zanata.xml absent
[mvn] Glossary-push compendium PO file: failed to run if zanata.xml absent
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-Maven (Show other bugs)
1.6-SNAPSHOT
Unspecified Linux
unspecified Severity medium
: ---
: 1.6.1
Assigned To: Alex Eng
Ding-Yi Chen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-30 02:06 EDT by Ding-Yi Chen
Modified: 2012-07-03 01:27 EDT (History)
3 users (show)

See Also:
Fixed In Version: 1.6.1-SNAPSHOT
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-03 01:27:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ding-Yi Chen 2012-05-30 02:06:16 EDT
Version-Release number of selected component (if applicable):
1.6.0-beta-2-SNAPSHOT (20120530-0019)

Steps to Reproduce: 
1. run without zanata.xml

Actual results: 
[ERROR] Failed to execute goal org.zanata:zanata-maven-plugin:1.6-SNAPSHOT:glossary-push (default-cli) on project null: Zanata mojo exception: NullPointerException

Expected results:
glossary-push need not require zanata.xml,
or at least give more informative error such as
"Cannot find zanata.xml"
Comment 1 Alex Eng 2012-06-04 21:31:40 EDT
Fixed in zanata maven client version 1.6.1-SNAPSHOT.

See https://github.com/zanata/zanata-client/commit/dacfdb3a70aef7d134c5a39ccb5914f93c6085e7
Comment 2 Ding-Yi Chen 2012-06-11 23:39:19 EDT
As tested with  org.zanata:zanata-maven-plugin:1.6.1-SNAPSHOT

It does shows 

[WARNING] Project config file '/home/dchen/devel/zanata-tests/zanata.xml' not found; ignoring

Yet the command still failed as NullPointerException


[ERROR] Failed to execute goal org.zanata:zanata-maven-plugin:1.6.1-SNAPSHOT:glossary-push (default-cli) on project null: Zanata mojo exception: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.zanata:zanata-maven-plugin:1.6.1-SNAPSHOT:glossary-push (default-cli) on project null: Zanata mojo exception
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Zanata mojo exception
        at org.zanata.maven.ConfigurableMojo.execute(ConfigurableMojo.java:134)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.lang.NullPointerException
        at org.zanata.client.commands.glossary.push.AbstractGlossaryPushReader.getLocaleFromMap(AbstractGlossaryPushReader.java:45)
        at org.zanata.client.commands.glossary.push.GlossaryCSVReader.setupLocalesMap(GlossaryCSVReader.java:124)
        at org.zanata.client.commands.glossary.push.GlossaryCSVReader.extractGlossary(GlossaryCSVReader.java:56)
        at org.zanata.client.commands.glossary.push.GlossaryPushCommand.run(GlossaryPushCommand.java:140)
        at org.zanata.maven.ConfigurableMojo.runCommand(ConfigurableMojo.java:145)
        at org.zanata.maven.ConfigurableMojo.execute(ConfigurableMojo.java:130)
        ... 21 more
Comment 4 Alex Eng 2012-06-18 18:57:11 EDT
Applied fix in zanata maven client version 1.6.1-SNAPSHOT

See https://github.com/zanata/zanata-client/commit/d5ba307730b7b74cbc5fd2021491936e8e334c13
Comment 5 Ding-Yi Chen 2012-06-28 03:04:46 EDT
VERIFIED with: 
client API version: 1.6.0-alpha-2, server API version: 1.6.0
1. Server Zanata version 1.6.1-SNAPSHOT (20120628-0014)
2. Server Zanata version 1.7-SNAPSHOT (20120626-0025)

Note You need to log in before you can comment on or make changes to this bug.