You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Glen Mazza <gl...@verizon.net> on 2008/02/22 18:51:20 UTC

Want to debug/trace WSDL2Java within Eclipse

Team,

I'm trying to debug/trace the trunk version of our WSDL2Java tool within
Eclipse, but the IDE can't seem to find the source code for the CXF
project modules.  All other third-party libraries needed by CXF it can
find the source for however.

Stated another way, in the .classpath file that mvn eclipse:eclipse
generates, the sourcepath attributes are listed for non-CXF libraries
but not for CXF ones:

<snippet>
<-- non-CXF are good, they have sourcepath attributes: -->

  <classpathentry kind="var"
path="M2_REPO/velocity/velocity-dep/1.4/velocity-dep-1.4.jar"
sourcepath="M2_REPO/velocity/velocity-dep/1.4/velocity-dep-1.4-sources.jar"/>  
  <classpathentry kind="var"
path="M2_REPO/org/apache/ws/commons/schema/XmlSchema/1.3.2/XmlSchema-1.3.2.jar" sourcepath="M2_REPO/org/apache/ws/commons/schema/XmlSchema/1.3.2/XmlSchema-1.3.2-sources.jar"/>

<-- CXF missing sourcepath attributes: -->

  <classpathentry kind="var"
path="M2_REPO/org/apache/cxf/cxf-common-schemas/2.1-incubator-SNAPSHOT/cxf-common-schemas-2.1-incubator-SNAPSHOT.jar"/>  
  <classpathentry kind="var"
path="M2_REPO/org/apache/cxf/cxf-tools-common/2.1-incubator-SNAPSHOT/cxf-tools-common-2.1-incubator-SNAPSHOT.jar"/>
</snippet>

I think the problem is that "mvn clean install" from the CXF trunk is
installing the JARs in my local repository, but not the sources of them
(I can't find the sources there like I can find for the third party
JARs.) [1] below seems to indicate that would be the source of this
problem.

The process I followed:  I checked out the CXF trunk and built the
project using "mvn clean install -Dmaven.test.skip".  I next ran "mvn
eclipse:clean eclipse:eclipse -DdownloadSources=true" from the
trunk/tools/wsdlto/core directory (where WSDL2Java is).  Next, I
imported the trunk/tools/wsdlto/core project into Eclipse.  

Anyone know how to get mvn eclipse:eclipse to include the sourcepaths in
the .classpath file for the CXF libraries like it does for the non-CXF
libraries?  (Or alternatively, I think, how to get "mvn install" to
install the CXF sources into my local repository just as it does the CXF
JARs?)

Thanks,
Glen

[1]
http://maven.apache.org/plugins/maven-eclipse-plugin/examples/attach-library-sources.html


Re: Want to debug/trace WSDL2Java within Eclipse

Posted by Daniel Kulp <dk...@apache.org>.
Glen,

By default, maven doesn't build source jars (as that would slow the build 
down for everyone).   There are a couple ways to proceed:

1) Run "mvn source:jar install -Pfastinstall 
or similar to tell maven to also build the source jars before install 
time.  They would then get installed and eclipse:eclipse will find them 
later.

2) If you REALLY want to start working in eclipse to develop CXF, follow 
the steps at:
http://cwiki.apache.org/confluence/display/CXF/Setting+up+Eclipse
The -Psetup.eclipse profile will completely setup the eclipse workspace 
with checkstyle rules, pmd rules, linked projects, etc...   You can 
change the code to see stuff immediately, etc...

Of course, CXF consists of something like 50 projects which is a big list 
when imported into eclipse.  The "Package Explorer" tab gets pretty 
long.   That's when using eclipse working sets can help.   I have a 
couple working sets setup to help manage it.   Example: I have a "tools" 
working set that just has the tools projects.  I have a jaxws projects 
with just the stuff I need for jaxws stuff, etc...

Dan



On Friday 22 February 2008, Glen Mazza wrote:
> Team,
>
> I'm trying to debug/trace the trunk version of our WSDL2Java tool
> within Eclipse, but the IDE can't seem to find the source code for the
> CXF project modules.  All other third-party libraries needed by CXF it
> can find the source for however.
>
> Stated another way, in the .classpath file that mvn eclipse:eclipse
> generates, the sourcepath attributes are listed for non-CXF libraries
> but not for CXF ones:
>
> <snippet>
> <-- non-CXF are good, they have sourcepath attributes: -->
>
>   <classpathentry kind="var"
> path="M2_REPO/velocity/velocity-dep/1.4/velocity-dep-1.4.jar"
> sourcepath="M2_REPO/velocity/velocity-dep/1.4/velocity-dep-1.4-sources
>.jar"/> <classpathentry kind="var"
> path="M2_REPO/org/apache/ws/commons/schema/XmlSchema/1.3.2/XmlSchema-1
>.3.2.jar"
> sourcepath="M2_REPO/org/apache/ws/commons/schema/XmlSchema/1.3.2/XmlSc
>hema-1.3.2-sources.jar"/>
>
> <-- CXF missing sourcepath attributes: -->
>
>   <classpathentry kind="var"
> path="M2_REPO/org/apache/cxf/cxf-common-schemas/2.1-incubator-SNAPSHOT
>/cxf-common-schemas-2.1-incubator-SNAPSHOT.jar"/> <classpathentry
> kind="var"
> path="M2_REPO/org/apache/cxf/cxf-tools-common/2.1-incubator-SNAPSHOT/c
>xf-tools-common-2.1-incubator-SNAPSHOT.jar"/> </snippet>
>
> I think the problem is that "mvn clean install" from the CXF trunk is
> installing the JARs in my local repository, but not the sources of
> them (I can't find the sources there like I can find for the third
> party JARs.) [1] below seems to indicate that would be the source of
> this problem.
>
> The process I followed:  I checked out the CXF trunk and built the
> project using "mvn clean install -Dmaven.test.skip".  I next ran "mvn
> eclipse:clean eclipse:eclipse -DdownloadSources=true" from the
> trunk/tools/wsdlto/core directory (where WSDL2Java is).  Next, I
> imported the trunk/tools/wsdlto/core project into Eclipse.
>
> Anyone know how to get mvn eclipse:eclipse to include the sourcepaths
> in the .classpath file for the CXF libraries like it does for the
> non-CXF libraries?  (Or alternatively, I think, how to get "mvn
> install" to install the CXF sources into my local repository just as
> it does the CXF JARs?)
>
> Thanks,
> Glen
>
> [1]
> http://maven.apache.org/plugins/maven-eclipse-plugin/examples/attach-l
>ibrary-sources.html



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog