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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:51:48+00:00 2026-05-15T07:51:48+00:00

We’ve got a project set up to use the Maven Release Plugin which includes

  • 0

We’ve got a project set up to use the Maven Release Plugin which includes a phase that unpacks a JAR of XML schemas pulled from Artifactory and a phase that generates XJC classes. We’re on maven release 2.2.1.

Unfortunately the latter phase is executing before the former which means that it isn’t generating the XJC classes for the schema. A partial POM.XML looks like:

 <plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
      <source>1.6</source>
      <target>1.6</target>
    </configuration>
  </plugin>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
      <execution>
        <id>unpack</id>
        <!-- phase>generate-sources</phase -->
        <goals>
          <goal>unpack</goal>
          <goal>copy</goal>
        </goals>
        <configuration>
          <artifactItems>
            <artifactItem>
              <groupId>ourgroupid</groupId>
              <artifactId>ourschemas</artifactId>
              <version>5.1</version>
              <outputDirectory>${project.basedir}/src/main/webapp/xsd</outputDirectory>
              <excludes>META-INF/</excludes>
              <overWrite>true</overWrite>
            </artifactItem>
          </artifactItems>
        </configuration>
      </execution>
    </executions>
  </plugin>
   <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>maven-buildnumber-plugin</artifactId>
    <version>0.9.6</version>
    <executions>
        <execution>
            <phase>validate</phase>
            <goals>
                <goal>create</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <doCheck>true</doCheck>
        <doUpdate>true</doUpdate>
    </configuration>
  </plugin>
  <plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <configuration>
        <schemaDirectory>${project.basedir}/src/main/webapp/xsd</schemaDirectory>
        <schemaIncludes>
            <include>*.xsd</include>
            <include>*/*.xsd</include>
        </schemaIncludes>
        <verbose>true</verbose>
        <!-- args>
            <arg>-Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=org.apache.xerces.jaxp.validation.XMLSchemaFactory</arg>
        </args-->
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
</plugin>

I’ve tried googling for it, unfortunately I ended up with a case of thousands of links none of which were actually relevant so I’d be very grateful if someone knew how to configure the order of the release plugin steps to ensure a was fully executed before it did b.

Thanks

  • 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-05-15T07:51:49+00:00Added an answer on May 15, 2026 at 7:51 am

    There has been some issues with ordering of execution (e.g. MNG-3719, MNG-2258) but it should be fine with Maven 2.2.1 and plugins should be executed in the same order as they are listed in the POM when bound to the same phase. And indeed, with your POM slightly modified:

    • I uncommented the <phase>generate-sources</phase> of the dependency plugin
    • I added id to the execution elements
    • I used a “fake” dependency for the dependency plugin

    I get the following output:

    $ mvn generate-sources 
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Q3070794
    [INFO]    task-segment: [generate-sources]
    [INFO] ------------------------------------------------------------------------
    [INFO] [dependency:unpack {execution: step1-unpack}]
    [INFO] Configured Artifact: c3p0:c3p0:0.9.1.2:jar
    [INFO] Unpacking /home/pascal/.m2/repository/c3p0/c3p0/0.9.1.2/c3p0-0.9.1.2.jarto
     /home/pascal/Projects/stackoverflow/Q3070794/src/main/webapp/xsd
    with Includes null and excludes:META-INF/
    [INFO] [dependency:copy {execution: step1-unpack}]
    [INFO] Configured Artifact: c3p0:c3p0:0.9.1.2:jar
    [INFO] Copying c3p0-0.9.1.2.jar to /home/pascal/Projects/stackoverflow/Q3070794/src/main/webapp/xsd/c3p0-0.9.1.2.jar
    [INFO] [jaxb2:generate {execution: step2-xjc}]
    [INFO] Started execution.
    ...
    

    The dependency:unpack and dependency:copy is done BEFORE jaxb2:generate. Unless I’m missing something, this is the expected result. Tested with Maven 2.2.1.

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

Sidebar

Ask A Question

Stats

  • Questions 454k
  • Answers 454k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try this. Make sure it will be in /Areas/Admin/AdminAreaRegistration.cs when… May 15, 2026 at 9:50 pm
  • Editorial Team
    Editorial Team added an answer The image needs to be part of the site if… May 15, 2026 at 9:50 pm
  • Editorial Team
    Editorial Team added an answer I guess you could use Interfacebuilder to write your Window-class… May 15, 2026 at 9:50 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.