axis2-wsdl2code-maven-plugin uses wrong directory to grab the wsdl file when 
building with parent project
---------------------------------------------------------------------------------------------------------

                 Key: AXIS2-4681
                 URL: https://issues.apache.org/jira/browse/AXIS2-4681
             Project: Axis2
          Issue Type: Bug
          Components: codegen
    Affects Versions: 1.5.1
         Environment: Linux, Sun JDK 1.6
            Reporter: Andreas Wuest
         Attachments: workspace.tar.gz

Hi,

i have the following project structure:

+root
   + master (which is the parent project)
      + pom.xml  (shared pom definitions)
   + client-axis2 (which is a module)
      + pom.xml (module specific definitions)

when i use the pom.xml in client-axis2 generating the webservice client from 
the wsdl works fine.
however when i use the pom.xml from the master, to build my client-axis2 module 
the build fails, because
the axis2-wsdl2code-maven-plugin looks in the work directory for the wsdl file:

the wsdl location in the plugin is configured as :

                                <configuration>
                                        
<packageName>com.foo.myservice</packageName>
                                        
<wsdlFile>src/wsdl/PersonService.wsdl</wsdlFile>
                                </configuration>

the location should be relative to the module directory, not relative to the 
parent directory (at least
all other maven plugins behave like that).

i have attached a little testcase, that shows the problem. see the attached 
file.
just run 
mvn clean package in the master directory (this will fail)
however, running "mvn clean package" in the client-axis2 directory will work.

and here is the error message i get. as you can see the wsdl is looked for in 
the wrong directory:

file:/tmp/directory_with_blanks/workspace/master/src/wsdl/PersonService.wsdl 
however it should be
file:/tmp/directory_with_blanks/workspace/client-axis2/src/wsdl/PersonService.wsdl

[INFO] Unable to find resource 'ws-commons:tcpmon:pom:1.0' in repository 
central (http://repo1.maven.org/maven2)
[INFO] [axis2-wsdl2code:wsdl2code {execution: default}]
Retrieving document at 'src/wsdl/PersonService.wsdl'.
java.io.FileNotFoundException: This file was not found: 
file:/tmp/directory_with_blanks/workspace/master/src/wsdl/PersonService.wsdl
        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(CodeGenerationEngine.java:288)
        at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:111)
        at 
org.apache.axis2.maven2.wsdl2code.WSDL2CodeMojo.execute(WSDL2CodeMojo.java:558)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR

cheers,
andy



  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to