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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:43:39+00:00 2026-06-17T06:43:39+00:00

I have a multi-module project in which I’m trying to set up the license

  • 0

I have a multi-module project in which I’m trying to set up the license plugin to manage all the licenses. Here’s the project setup:

─── transfuse-project
    ├── examples
    │   ├── helloAndroid
    │   │   ├── pom.xml
    │   │   ├── ...
    │   ├── integrationTest
    │   │   ├── pom.xml
    │   │   ├── ...
    │   ├── pom.xml
    │   └── ...
    ├── transfuse
    │   ├── pom.xml
    │   ├── ...
    ├── transfuse-api
    │   ├── pom.xml
    │   ├── ...
    ├── NOTICE
    └── pom.xml

Each pom.xml inherits from the transfuse-project pom.xml. In the project pom.xml I have set up the license plugin to apply the NOTICE to the relevant files:

        <plugin>
            <groupId>com.mycila.maven-license-plugin</groupId>
            <artifactId>maven-license-plugin</artifactId>
            <version>1.9.0</version>
            <configuration>
                <header>NOTICE</header>
                <includes>
                    <include>**/*.java</include>
                    <include>**/*.xml</include>
                </includes>
                <excludes>
                    <exclude>**/.*/**</exclude>
                    <exclude>target/**</exclude>
                    <exclude>**/AndroidManifest.xml</exclude>
                </excludes>
                <properties>
                    <year>2013</year>
                    <name>John Ericksen</name>
                </properties>
                <useDefaultExcludes>true</useDefaultExcludes>
                <strictCheck>true</strictCheck>
            </configuration>
            <executions>
                <execution>
                    <id>check-headers</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

This configuration works if I build directly off of the root (transfuse-project). The problem arises when I build the integrationTest example or api directly. Maven cannot find the NOTICE file I provided in the project root:

[ERROR] Failed to execute goal com.mycila.maven-license-plugin:maven-license-plugin:1.9.0:check (check-headers) on project transfuse-api: Some files do not have the expected license header -> [Help 1]

And what’s worse, it finds another dependency’s NOTICE file. If I run mvn license:format in a sub-module it replaces all of the module’s headers with the dependency’s NOTICE file.

I believe I can add a NOTICE file within each sub-module to fix this problem and configure each sub-module pom with its own license plugin, but I would like to avoid that duplication if possible. Is there some configuration or setup that will work with my project setup?

  • 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-17T06:43:40+00:00Added an answer on June 17, 2026 at 6:43 am

    Try to use an absolute path by using

    <header>${basedir}/NOTICE</header>
    

    If this doesn’t work, try to set a property to and in the parent module’s basedir and use it:

    <header>${main.basedir}/NOTICE</header>
    

    A third option is setting a property at runtime:

    mvn clean install -Dmain.basedir=path/to/main/basedir
    

    Edit:

    Ok, a whole other option is to execute the maven-dependency-plugin before your license plugin. But you have to make sure the parent attaches the NOTICE (with maven-assembly-plugin plugin)

    <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-dependency-plugin</artifactId>
             <version>2.6</version>
             <executions>
               <execution>
                 <id>unpack-parent</id>
                 <phase>verify</phase>
                 <goals>
                   <goal>unpack</goal>
                 </goals>
                 <configuration>
                   <artifactItems>
                     <artifactItem>
                       <groupId>parent</groupId>
                       <artifactId>parent</artifactId>
                       <version>parent</version>
                       <type>pom</type>
                       <overWrite>false</overWrite>
                       <outputDirectory>${project.build.directory}/license</outputDirectory>
                       <includes>NOTICE</includes>
                     </artifactItem>
                   </artifactItems>
                 </configuration>
               </execution>
             </executions>
           </plugin>
    

    The header changes then in:

    <header>${project.build.directory}/license/NOTICE</header>
    

    Edit2:

    I came across the find-maven-plugin. I think this could work:

    <plugin>
        <groupId>com.github.goldin</groupId>
        <artifactId>find-maven-plugin</artifactId>
        <version>0.2.5</version>
        <executions>
            <execution>
                <id>find-notice-file</id>
                <goals>
                    <goal>find</goal>
                </goals>
                <phase>validate</phase>
                <configuration>
                    <propertyName>notice.file</propertyName>
                    <file>NOTICE</file>
                </configuration>
            </execution>
        </executions>
    </plugin>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-module maven project which has profiles set up. So if I
I have a multi-module maven 2 project which uses assemblies (via maven-assembly-plugin at the
We have a multi-module project on which I wanted to use the release plugin.
I have a project in which the maven-enforcer rule fails with a multi-module build
We have a multi-module maven project that uses a profile that defines a buildnumber-maven-plugin
I am using soapUI maven plugin to create a multi-module maven-soapUi project. I have
I'm trying to set up a multi-module Maven project, and the inter-module dependencies are
I have a huge multi-module project , which is being built using maven. Most
I have a multi module maven project which looks something like: main component_one subcomponent_bob
I have a multi-module maven project, and I'm trying to create an assembly for

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.