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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:03:02+00:00 2026-06-08T01:03:02+00:00

I have several Maven projects, say a , b , c , inheriting from

  • 0

I have several Maven projects, say a,b,c, inheriting from a single parent (let’s call it parent), and also being modules (of a different project than parent, let’s call it super).

These projects all have a pom packaging. Each of these projects has specific configuration, but they also have a common part. To be more speficic, each project two JMeter test configuration files: one specialized for the given project, and another one that is common and identical for all projects.

The problem is – how should I configure the POMs so this common config file is shared among the projects?

A workaround would be to merge all of them into super, and use profiles. However, in this case, I would have to do a separate build for each configuration manually (whereas now I can just build super).

There are similar questions, like this one, but they deal with the jar plugin, which is not relevant for this case.

Structure, for reference:

  • POM Inheritance:

        parent
          |
    -------------
    |     |     |
    a     b     c
    
  • File structure:

    super
    |
    |-a
    |
    |-b
    |
    |-c
    
  • 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-08T01:03:03+00:00Added an answer on June 8, 2026 at 1:03 am

    I have used the maven-remote-resources-plugin for a similar purpose. Create a separate resources project (com.company:resourceProj) of type jar. Put the JMeter resource files in /src/main/resources.

    /src/main/resources/common.properties  (your filenames obviously)
    /src/main/resources/a.properties
    etc.
    

    Follow the directions in the example to create the bundle.

    Now, add this config to your parent POM (in a testing profile if you want):

    <properties>
      <shared.resources.dir>${project.build.directory}/shared-resources</shared.resources.dir>
    </properties>
    
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-remote-resources-plugin</artifactId>
      <executions>
        <execution>
          <id>load-resources</id>
          <phase>initialize</phase>
          <goals>
            <goal>process</goal>
          </goals>
          <configuration>
            <resourceBundles>
              <resourceBundle>com.company:resourceProj:version</resourceBundle>
            </resourceBundles>
            <attached>false</attached>
            <outputDirectory>${shared.resources.dir}</outputDirectory>
          </configuration>
        </execution>
      </executions>
    </plugin>
    

    Now, tell Maven these are test resources. If your test resource elements are consistent across the modules, this can go in the parent too, if they are different it goes in the module POM. (In my experience with Maven 3 resources defined in a child project take precedence over the parent’s; they aren’t merged.)

    <testResources>
        <testResource>
          <directory>${shared.resources.dir}</directory>
          <includes>
             <include>common.properties</include>
             <include>${module.file}.properties</include>
          </includes>
        </testResource>
        <!-- any other test resources here -->
      </testResources>
    

    In the child module, define the resources module property (this is module a):

    <properties>
      <module.file>a</module.file>
    </properties>
    

    Adapt this to meet your use case.

    —- Edit —-

    If the configuration is placed into a parent POM, the parent POM may fail to build depending on what configuration is provided by the child. When we are building the shared base/parent projects we don’t want to require that all of the properties that should be provided by child projects (inheriters) are defined. So we activate this profile when building the shared projects to bypass anything that only applies to children.

    To do this, add an empty file pom-packaging.marker to the parent project’s basedir. Then add this profile to the parent POM. When the parent project is built, Maven will find the marker file, enable the profile, and disable all of the executions included in the profile. When a child project is built, the marker file doesn’t exist, so the configuration in the main part of the POM will take effect.

    I’ve used this technique with the Enforcer plugin as well – the parent defines the enforcer rules that should be applied to projects inheriting from the parent, but cannot satisfy the rules when it is built. If the plugin provides a “skip” property, you may enable that in this profile instead of using phase = none in plugin configuration.

    <profile>
        <id>pom-packaging</id>
        <activation>
            <file>
                <exists>pom-packaging.marker</exists>
            </file>
        </activation>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-remote-resources-plugin</artifactId>
                    <executions>
                        <execution>
                                <id>load-resources</id>
                                <phase>none</phase>    <!-- disables this execution -->
                            </execution>
                        </executions>
                    </plugin>
              ....  other plugin executions here ....
             </plugins>
        </build>
    </profile>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have maven parent project with several child projects. On deploy I want to
I have a Maven project that consists of several modules. I have a single
I have maven project with several modules. Need to deploy all modules( jars and
I have several Maven projects in eclipse that depends on each other. Some of
I have maven project that consists of several modules. I want to add an
I have several Maven projects that each have some common functionality or at least
I'm facing a problem with maven build. I have several ejb projects. After maven
In a maven project I have several modules which only have a persitence.xml for
I have several Maven modules with Vaadin library dependency in the root pom.xml file.
I'm developing a maven project with several modules in eclipse. The parent pom.xml declares

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.