I have a maven project wherein i am consuming a webservice using wsimport
as a goal during project build.
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<!-- -->
<configuration>
<wsdlUrls>
<wsdlUrl>http://localhost:8081/email-service/services/EmailService?wsdl</wsdlUrl>
</wsdlUrls>
<sourceDestDir>${project.build.directory}/generated</sourceDestDir>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<finalName>EmailServiceClient</finalName>
I build the project using clean install
command. The artifacts/classes are generated in target->generated
directory. So far so good.
Now when i tried to access any of the generated class in my src
directory, i get compiler error stating that the class is not defined. My peer told me to build the project using
eclipse:clean eclipse:eclipse
I did and it solved the problem. I was able to use those generated classes very easily. Now I am wondering
wsdl2java
but what is wrong with this?Has anyone ever encountered this type of situation? Please throw some light on this. Thank you!
I am not sure the reason behind your problem " when i tried to access any of the generated class in my src directory, i get compiler error stating that the class is not defined. " But I can tell you the meaning of command you are using
As far as I know in maven we can define more than one goal at a time to execute so
eclipse:clean \\Deletes the .project, .classpath, .wtpmodules files and .settings folder used by Eclipse.
eclipse:eclipse \\build the project into eclipse project like structure.