Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8764373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:01:08+00:00 2026-06-13T16:01:08+00:00

At my work used jaxws-maven-plugin for code generation. I have two projects are common

  • 0

At my work used jaxws-maven-plugin for code generation.
I have two projects are “common” and” client “. Structure roughly as follows:

app/
  common/
    resource/
      some.xsd
  client/
    resource/
      some.wsdl

How can I generate classes from wsdl in the project “client”, using the xsd from the project “common”?

pom.xml:

            <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <verbose>true</verbose>
                        <bindingFiles>
                            <bindingFile>${project.parent.basedir}/common/resource/some.xsd</bindingFile>
                        </bindingFiles>
                        <wsdlFiles>
                            <wsdlFile>/resource/some.wsdl</wsdlFile>
                        </wsdlFiles>
                    </configuration>
                </execution>
            </executions>
        </plugin>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:01:09+00:00Added an answer on June 13, 2026 at 4:01 pm

    First of all you should stick to the maven conventions, use src/main/resources/ directories for resources.

    After doing that then you can use the maven-dependency-plugin:unpack-dependencies to unpack the common jar file to access the some.xsd:

    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <parent>
            <groupId>com.stackoverflow.Q13155047</groupId>
            <artifactId>app</artifactId>
            <version>1.0-SNAPSHOT</version>
        </parent>
    
        <artifactId>client</artifactId>
    
        <name>${project.artifactId}-${project.version}</name>
    
        <properties>
            <schema.location>${project.build.directory}/schemas</schema.location>
        </properties>
    
        <dependencies>
            <dependency>
                <groupId>com.stackoverflow.Q13155047</groupId>
                <artifactId>common</artifactId>
            </dependency>
        </dependencies>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.5.1</version>
                    <executions>
                        <execution>
                            <id>unpack-dependencies</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>unpack-dependencies</goal>
                            </goals>
                            <configuration>
                                <includes>**/*.xsd</includes>
                                <outputDirectory>${schema.location}</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jaxws-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>wsimport</goal>
                            </goals>
                            <configuration>
                                <verbose>true</verbose>
                                <bindingDirectory>${schema.location}</bindingDirectory>
                                <bindingFiles>
                                    <bindingFile>some.xsd</bindingFile>
                                </bindingFiles>
                                <wsdlDirectory>src/main/resources</wsdlDirectory>
                                <wsdlFiles>
                                    <wsdlFile>some.wsdl</wsdlFile>
                                </wsdlFiles>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>
    

    The jaxws-maven-plugin is bound to the generate-sources phase so adding the maven-dependency-plugin before the jaxws-maven-plugin and to the same phase makes sure that it unpacks everything before applying the wsimport goal.

    Make sure that <bindingDirectory/> and <wsdlDirectory/> are correct.


    This is how you should do it if you have the *.xsd files in another project. Never access other projects with relative paths. Each project should only access other resources using the dependency mechanism.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to work with jQuery and was using jQuery LazyLoad Plugin http://www.appelsiini.net/projects/lazyload jQuery
Where I used to work, we version-controlled with Mercurial. I have a new job
This code used to work but doesnt any more. i used a breakpoint, and
This code used to work. Then, maybe I changed something, somewhere (or if I
This piece of code used to work in MVC 1 but it does not
I swear the following code used to work, even in IE7 but now i
I have an home work,I used an array and element of array is linked
How come the conditional operator ( ?: ) doesn't work when used with two
An old work colleague used to quote his father about tools, You have to
Cocoa used to work on CS3 with the trick of putting a Cocoa bundle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.