This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
simple (default ide generated)maven jaxws client reports wrong package structure for project/other-nodes element see attached jpeg
Created attachment 108140 [details] shows wrong nodes at left of image
(In reply to comment #0) > simple (default ide generated) maven jaxws client I am not sure precisely what the reporter means by this - which wizard(s) were run? - but anyway I did find the MavenCalculatorClient sample project which exhibits the problem. In that case there are two issues: 1. The initial POM just has an empty <includes/> tag, which is nonsense and results in the entire source tree being copied into target/classes/META-INF/! I do not know much about JAX-WS but I guess what was intended was <resources> <resource> <targetPath>META-INF</targetPath> <directory>src</directory> <includes> <include>jax-ws-catalog.xml</include> <include>wsdl/</include> </includes> </resource> </resources> 2. Bug #195928 causes a spurious error badge to appear on the project.
Reassigning for #1.
(In reply to comment #2) > > 1. The initial POM just has an empty <includes/> tag, which is nonsense and > results in the entire source tree being copied into target/classes/META-INF/! I > do not know much about JAX-WS but I guess what was intended was > > <resources> > <resource> > <targetPath>META-INF</targetPath> > <directory>src</directory> > <includes> > <include>jax-ws-catalog.xml</include> > <include>wsdl/</include> > </includes> > </resource> > </resources> > I think you are right about content of includes element. But I'm not an expert in Maven . Does it really means that only jax-ws-catalog.xml file and wsdl catalog should be included only ? I'm asking it because the proposed change of the pm.xml file doesn't lead to some changes in the Project explorer. Other sources node still contains the same wrong packages. Is it some issue or something that I did wrong ?
Jesse, please help me with the latest comment.
(In reply to comment #4) > I think you are right about content of includes element. > But I'm not an expert in Maven . > Does it really means that only jax-ws-catalog.xml file and wsdl catalog should > be > included only ? That is up to the JAX-WS domain expert. Certainly src/main/ and src/test/ dirs should not be copied to target/classes/src/main/ and target/classes/src/test/, which is what happens now and is clearly a mistake. > I'm asking it because the proposed change of the pm.xml file doesn't lead to > some changes in the Project explorer. > Other sources node still contains the same wrong packages. > Is it some issue or something that I did wrong ? As I said in comment #2, that is a separate issue.
(In reply to comment #6) > (In reply to comment #4) > > I think you are right about content of includes element. > > But I'm not an expert in Maven . > > Does it really means that only jax-ws-catalog.xml file and wsdl catalog should > > be > > included only ? > > That is up to the JAX-WS domain expert. Certainly src/main/ and src/test/ dirs > should not be copied to target/classes/src/main/ and target/classes/src/test/, > which is what happens now and is clearly a mistake. Yes sure. But I've asked not from JAX-WS point of view but from Maven <includes> element presence/absnce. ( The next sentence is about it ). > > > I'm asking it because the proposed change of the pm.xml file doesn't lead to > > some changes in the Project explorer. > > Other sources node still contains the same wrong packages. > > Is it some issue or something that I did wrong ? > > As I said in comment #2, that is a separate issue. I missed this . Thanks. So this is the problem of Sample project only. Empty "includes" element is not added by any other wizard except Sample Maven Calculator Client.
> simple (default ide generated) maven jaxws client i created nb7 maven web project from scratch, then add 1 webservice --which results in a default method/operation added. this project builds, deploys fine. then -- after deployment of above, create ide generated maven java project. then using nb7 ide -- add webservice client, specify prev web project as wsdl location; then using nb7 insert-code in the main java class method -- call the jaxws webservice operation. project will build, run fine. but exhibits the described/reported problem.
(In reply to comment #8) > > simple (default ide generated) maven jaxws client > > i created nb7 maven web project from scratch, > then add 1 webservice --which results in a default method/operation > added. > > this project builds, deploys fine. > > then -- after deployment of above, create ide generated maven > java project. > > then using nb7 ide -- add webservice client, specify prev web project as > wsdl location; > > then using nb7 insert-code in the main java class method -- call > the jaxws webservice operation. > > project will build, run fine. > > but exhibits the described/reported problem. I'm able to reproduce it exactly as described here. NB adds "resources" element with empty "includes" right after WS client creation. So there are two problems : 1) Correct Maven Sample project. 2) Correct pom.xml modification .
This issue is inside maven.model module. There is a special code that handles situation exactly in the way as suggested : Resource res = model.getFactory().createResource(); res.setTargetPath("META-INF"); //NOI18N res.setDirectory("src"); //NOI18N res.addInclude("jax-ws-catalog.xml"); //NOI18N res.addInclude("wsdl/**"); //NOI18N bld.addResource(res); The code is inside org.netbeans.modules.maven.jaxws.MavenModelUtils.addWsdlResources() method. But the res.addInclude() is badly implemented . Its implementation is org.netbeans.modules.maven.model.pom.impl.ResourceImpl.addInclude(). The problem code is for (StringList list : lists) { if (getModel().getPOMQNames().INCLUDES.getName().equals(list.getPeer().getNodeName())) { list.addListChild(include); return; } } The condition in the "if" is false because getModel().getPOMQNames().INCLUDES.getName() equals "includes" but list.getPeer().getNodeName() contains prefix "pom" and equals "pom:includes". QNames are compared via names and this is incorrect. Probably there are a number of such incorrect code in the maven.model impl. QNames should be compared by names AND namespace. Prefix should not be checked at all. The Sample problem is consequence of incorrectly created project with described above issue. Maven model fix will not fix the sample project so I file different issue against JAX-WS client Sample.
See issue #198475 for MavenCalculatorClient client sample.
(In reply to comment #10) > getModel().getPOMQNames().INCLUDES.getName() equals "includes" > but list.getPeer().getNodeName() contains prefix "pom" and equals > "pom:includes". Reproduced according to instructions and also in a unit test. Surprisingly, seemingly identical code in ProjectImpl.addModule works fine. I am not sure, but I think the difference is that the ResourceImpl has a null parent field at the time that addInclude is called, and this somehow changes the way Element.getNodeName() (also getTagName) behaves.
core-main #cf21b68973a0
Integrated into 'main-golden', will be available in build *201105111436* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/cf21b68973a0 User: Jesse Glick <jglick@netbeans.org> Log: #198361: Empty <includes/> on Maven JAX-WS client project