[
https://issues.apache.org/jira/browse/AXIS2-3835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612360#action_12612360
]
Greg Lee-Shoy commented on AXIS2-3835:
--------------------------------------
It is possible to get around this problem by making the following changes in
WSDL2CodeMojo:
===
Add the method below:
/**
* The URI may be a relative file path
* If it is, we need to replace it with the absolute file path.
* If it isn't, return the original uri.
*
* @param currentURI
*/
private String getWsdlURI(String currentWsdlURI) throws
MojoFailureException {
if (currentWsdlURI == null) {
throw new MojoFailureException("Current wsdl URI cannot
be null");
}
// if it is a relative file path, it should start with "src" or
"wsdl" or something like that
//
if (currentWsdlURI.startsWith("src") ||
currentWsdlURI.startsWith("wsdl")) {
// Check if pre-pending the basedir produces an
existing file
//
File file = new File(project.getBasedir() +
File.separator +
currentWsdlURI);
if (file.exists()) {
return file.getPath();
}
getLog().debug("file doesn't exist: " + file.getPath());
}
return currentWsdlURI;
}
and use this new method in fillOptionMap():
...
getStringArray(getWsdlURI(wsdlFile)))); ...
...
===
> problem running wsdl2code in multi-level maven projects (at the parent
> project level)
> -------------------------------------------------------------------------------------
>
> Key: AXIS2-3835
> URL: https://issues.apache.org/jira/browse/AXIS2-3835
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: Tools
> Affects Versions: 1.4
> Environment: Windows XP Professional
> Reporter: Greg Lee-Shoy
> Priority: Critical
> Attachments: parent.zip
>
>
> Hi,
> Our team is currently using Axis2 version 1.3, and looking at upgrading to
> version 1.4. We've encountered a problem when using the 1.4 version of the
> wsdl2code maven plugin in maven projects that have parent-child
> relationships. When generating Java code from wsdl at the level of the child
> project there is no problem, but if we try to generate (i.e. run mvn clean
> install) at the level of the parent project then we get an error similar to
> the one below:
> java.io.FileNotFoundException: This file was not found:
> file:/C:/Java/parent/src
> /main/wsdl/Emailvernotestemail.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:290)
> at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
> ionEngine.java:112)
> at
> org.apache.axis2.maven2.wsdl2code.WSDL2CodeMojo.execute(WSDL2CodeMojo
> .java:559)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:443)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:539)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:480)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:459)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:311)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:278)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:143)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:85)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:58)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:60)
> at java.lang.reflect.Method.invoke(Method.java:391)
> 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
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Error parsing WSDL
> This file was not found:
> file:/C:/Java/parent/src/main/wsdl/Emailvernotestemail.
> wsdl
> It seems to exclude the child folder from the path to the wsdl file.
> I've included a zipped folder structure; running mvn clean install in the
> 'parent' directory compared to running in the 'child' directory should
> illustrate the problem...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]