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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:29:00+00:00 2026-05-16T10:29:00+00:00

Suppose I have a module A:jar , whose runtime and compilation set of dependencies

  • 0

Suppose I have a module A:jar, whose runtime and compilation set of dependencies depends on the JDK version. In my example, I have a pre-jdk6-profile for JAXB API: prior to JDK 1.6.0 I need to include jaxb-api-nnn.jar as a compile dependency. This profile is placed to A.pom.

I also have module B:war, which depends on A:jar. I want to be able to activate this profile on a build server to build the JDK 1.5.x deliverable. When I execute Maven with a given profile activated, I get the message:

mvn -Ppre-jdk6-profile -o install
[WARNING]
        Profile with id: 'pre-jdk6-profile' has not been activated.

and jaxb-api-nnn.jar is missing in resulting B.war. However if I activate this profile when building from the parent pom.xml, everything is OK. That means the profiles are not inherited from dependencies, and the parent multi-module pom.xml was able to build everything correctly because it seems like all profiles are merged in reactor.

Shifting the profile to parent pom makes things worse, as the dependencies are applied to all other projects (e.g. to C:ear). Are there nice solutions for this task, namely, if any module A depends on module B, then all compile and runtime dependencies which are activated by a profile, are correctly handled?

The profile in project A:jar follows:

<project ...>
    <artifactId>A</artifactId>
    <packaging>jar</packaging>
    ...
    <parent>
        <artifactId>P</artifactId>
        ...
    </parent>

    <profiles>
        <profile>
            <id>pre-jdk6-profile</id>

            <activation>
                <jdk>(,1.6.0)</jdk>
            </activation>

            <dependencies>
                <dependency>
                    <groupId>javax.xml.ws</groupId>
                    <artifactId>jaxws-api</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
...
</project>
  • 1 1 Answer
  • 3 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-16T10:29:01+00:00Added an answer on May 16, 2026 at 10:29 am

    a) In a multi-module build, you should always build from the top pom, never from an individual module. If you want to build only one module, use advanced reactor options (see mvn –help) like this:

    mvn -pl mymodule
    

    b) Define and activate the profile in the parent pom, but add the configuration in the child pom.

    parent pom.xml

    <profiles>
        <profile>
             <id>pre-jdk-6</id>
             <activation>
                <jdk>(,1.6.0)</jdk>
             </activation>
        </profile>
    </profiles>
    

    child pom.xml

    <profiles>
        <profile>
            <id>pre-jdk-6</id>
    
            <dependencies>
                <dependency>
                    <groupId>javax.xml.ws</groupId>
                    <artifactId>jaxws-api</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose you have a module that you know is safe. You want to mark
Suppose I have a large list of words. For an example: >>> with open('/usr/share/dict/words')
Suppose I have this code: class Example(object): def the_example(self): itsProblem = "problem" theExample =
Suppose I have a module which defines some basic constants such as integer, parameter
Suppose I have the module test.erl, and inside it is the macro TOTAL :
Suppose I have a relatively long module, but need an external module or method
Suppose I have following code: def foo(s): A dummy function foo. For example: >>>
Suppose we have two modules with cyclic dependencies: # a.py import b def f():
suppose you have two modules like module Foo.A where foo = 42 and module
Suppose, I have 3 stores. I want to disable a module in Store 2.

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.