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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:22:26+00:00 2026-06-02T23:22:26+00:00

Setup I have a project with a child project and want to do a

  • 0

Setup

I have a project with a child project and want to do a maven release of the child (Project B):

Project-A/
  pom.xml
  Project-B/
    pom.xml
    src/

The folder of Project-A is at the same time my git repository, which I clone from our central git server.

For our release we use the jenkins as build server with the Jenkins Maven Release Plug-in to start the release build.

So after the jenkins Job (called JobB) is started it will checkout the Project-A folder into the following place: /Users/titan/.jenkins/jobs/JobB/workspace.

Due to the way how git is working I can only clone the top level of my structure. So this means I need to set the pom I want to build in jenkins to Project-B/pom.xml which then will change the working directory maven uses for doing its work.

This creates a lot of issues with git as the maven release plugin tries to commit to the wrong directory (it assumes that Project-A/Project-B/ is a valid git repository). I could solve all such issues (by deactivating the pushes to the remote repo when doing the release and specifying the correct scm url when doing the release.)

This is the value of the Release goals and options field in the jenkins JobB configuration:

-X -DpreparationGoals="clean install" 
-DpushChanges=false 
-DconnectionUrl=scm:git:file:///Users/titan/.jenkins/jobs/JobB/workspace 
release:prepare release:perform

The file url for the connectionUrl is needed because I do not push the changes to the git remote server and the clone which is done at the beginning of maven:perform would not find the tag from which it needs to checkout.

Issue

And after all this here is my issue which I’m not able to solve:

The maven:prepare step runs through and does all its work (changing version numbers in pom, creating release tag).
Then the maven:perform step starts, clones the content from the git repository, checkouts tag into the target folder, and then invokes the deploy command.

But here is the issue the invoked deploy command is invoked on the top level so it is deploying Project-A instead of the Project-B. The job itself is running through without any errors it is just building and deploying the wrong thing.

Here is the command maven generates to execute the deploy:

[INFO] Executing goals 'deploy'...
[DEBUG] Using ${maven.home} of: '/usr/share/java/maven-3.0.3'.
[DEBUG] Executing: /bin/sh -c cd /Users/titan/.jenkins/jobs/jobB/workspace/Project-B/target/checkout && /usr/share/java/maven-3.0.3/bin/mvn -B -X -D maven.repo.local=/Users/titan/.m2/repository -s /Users/titan/.m2/settings.xml -D performRelease=true deploy

So it is invoking the pom file inside the checkout directory instead inside checkout/Project-B. Interestingly the maven:prepare step does execute on the correct pom.

What I tried so far

  • Not using jenkins, and invoking the mvm command directly from the shell. This gives me the same outcome. So I assume that jenkins is not the issue.

  • Changing the path for the pom with the -Darguments="-f sword-packaging-wbf/pom.xml" and with -Darguments="-DpomFileName=sword-packaging-wbf/pom.xml"

    Both methods do not change anything in the outcome. And looking at the output I see that the -f <path> is ignored in the generated commands where as the -DpomFileName is visible but does not change anything in the outcome.

  • 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-02T23:22:29+00:00Added an answer on June 2, 2026 at 11:22 pm

    So this means your organization is simply wrong. Put your parent into a separate maven module (also separate git repos) release it. In your child modules just use the parent and make your childs separate maven modules as well as git repos and release them separately. That’s it. Otherwise you start fighting with Maven and you will loose the combat.

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

Sidebar

Related Questions

I have a project setup like this: parent |_____project-a |_____project-b I want classes in
I am attempting to make a maven parent pom setup where I don't have
I have setup Maven project locally without eclipse, it is completed succefully. Now i
I have a Web setup project. In the setup I have an input field
I have a project to setup an anonymous feedback form to our website. I
I have a setup project that installs my app to the typical program files
I have a Project Collection setup in my TFS2010RC deployment. I have two Projects
I have setup an android test project that runs junit tests. It's using two
I have an Setup project that installs App.exe. App.exe depends on 1) A third
I have a Setup project (MSI) in VS2008 which installs my project. Within the

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.