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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:12:28+00:00 2026-06-03T17:12:28+00:00

I have parent project parent, which has three modules like: <groupId>com.dummy.bla.bla</groupId> <artifactId>parent</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging>

  • 0

I have parent project “parent”, which has three modules like:

 <groupId>com.dummy.bla.bla</groupId>
 <artifactId>parent</artifactId>
 <version>1.0-SNAPSHOT</version>
 <packaging>pom</packaging>

<modules>
    <module>A</module>
    <module>B</module>
    <module>C</module>
</modules>

and three modules are depending on each other like a chain:

A<--B<--C

When I run the build under parent, I will have A-1.0-SNAPSHOT.jar generated first, then B-1.0-SNAPSHOT.jar, finally C-1.0-SNAPSHOT.jar.

Then problem is that, I have another maven profile to generate nightly build every day.In my parent pom.xml I have:

<build>
    <profile>
    <id>nightlybuild</id>
    <finalName>${artifcateId}-${buildNumber}</finalName>
    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>create</goal>
            </goals>
       </execution>
    </executions>
    <configuration>
        <doCheck>false</doCheck>
        <doUpdate>false</doUpdate>
        <format>{0,date,yyyy-MM-dd_HH-mm}_{1}</format>
        <items>
            <item>timestamp</item>
            <item>${user.name}</item>
        </items>
    </configuration>
</plugin>
</build>

Then I have problem to build all the modules using the profile “nighlybuild”, because it firstly generates A-${buildNumber}.jar, then when it builds B, it fails to look for A-1.0-SNAPSHOT.jar(because under B/pom.xml I have A as a dependency with version 1.0-SNAPSHOT). Is there anyway the pom.xml under B can have something like:

if(normal build) {
    dependency A version is: 1.0-SNAPSHOT
}
if(nightly build) {
    dependency A version is: ${buildNumber}
}
  • 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-03T17:12:30+00:00Added an answer on June 3, 2026 at 5:12 pm

    This is not really good practice. If you’re changing version, then you must really be releasing your artifacts, i.e. using maven-release-plugin (can still do that during your nightly build).

    But to answer your question, nothing really stops you from moving your dependency declaration in project B into a profile though I don’t think you can use properties set by plugins inside dependency version declaration.

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

Sidebar

Related Questions

I have a parent POM with the following config <groupId>com.example</groupId> <artifactId>parent</artifactId> <version>1.2-SNAPSHOT</version> Each child
Currently, I have a Maven project which inherits from a parent pom defining two
We have a sub-project 'commonUtils' that has many generic code-snippets used across the parent
I have a parent object which has a one to many relationship with an
I have a project with a parent pom.xml which define profiles, and a debug
I have a parent project that is branched to many dependent child projects. I
I have a Maven multi-module project and I need two different parent POMs in
For educational purposes I have set up a project layout like so (flat in
I have a multi module maven project and I would like to use versions
In my windows forms project I have a parent form that is creates other

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.