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 8049245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:44:14+00:00 2026-06-05T06:44:14+00:00

I have a maven project which uses wsgen to generate XSD files from the

  • 0

I have a maven project which uses wsgen to generate XSD files from the compiled java classes.

The problem is that I want to add the generated files to the jar as resources. But since the resource phase runs before the process-classes phase, I can’t add them.

Is there a way to tell maven to add additional resources that were generated at the process-classes phase?

  • 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-05T06:44:16+00:00Added an answer on June 5, 2026 at 6:44 am

    I would suggest to define the output directory for the XSD files into target/classes (may be with a supplemental sub folder which will be packaged later during the package phase into the jar. This can be achieved by using the maven-resources-plugin.

    <project>
      ...
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.0.2</version>
            <executions>
              <execution>
                <id>copy-resources</id>
                <phase>process-classes</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                  <resources>          
                    <resource>
                      <directory>${basedir}/target/xsd-out</directory>
                      <filtering>false</filtering>
                    </resource>
                  </resources>              
                </configuration>            
              </execution>
            </executions>
          </plugin>
        </plugins>
        ...
      </build>
      ...
    </project>
    

    You need to take care that the resources plugin is positioned after the plugin which is used to call the wsgen part. You can also use the prepare-package phase instead to make sure the resources will be correctly packaged.

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

Sidebar

Related Questions

I have a maven project A which uses jar files of another project B
For my Java project which uses Maven I have added Twitters Bootstrap lately to
I have a java/maven project that uses tango icons, so I'm using the following
I have an Android Maven project, which uses pure Java libs, I've struggled with
I have a maven project which won't compile due to an unresolvable reference from
Currently, I have a Maven project which inherits from a parent pom defining two
I have a maven Java project (Project A) which depends on a second project
Say you have a project that uses maven and a subversion repository. It consists
I have a maven project which uses the shade plugin to create a jar
I have a maven project, which has quite different settings in the properties files

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.