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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:17:14+00:00 2026-05-13T08:17:14+00:00

I have a set of Maven projects and I’d like to define access rules.

  • 0

I have a set of Maven projects and I’d like to define access rules.
For example, projects Database and Cache may only be accessed by project DataLayer, but not from project UiLayer. I’m speaking in terms of maven projects, but a package level access verification may also work, as long as it’s easy to integrate into maven projects.

I’ve looked at Macker, which has a nice set of features such as access control b/w java packages, style checking etc, but have been having hard time tying that into a set of maven projects.

There’s the macker-maven-plugin, which is still under development, and I’ve been able to make it work for me, but I’m afraid it’s not going to serve me well.
This plugin runs verifications on all project’s classes.
This means that I’ll have to have macker-rules.xml defining access rules in each and every maven project from now on in order to make sure rules are not broken. This looks like a maintenance nightmare.

So – did I miss something with usage of macker-maven-plugin? Perhaps I’m not using it correctly.

I have no experience with JDepend, but from short reading it looks like the thin version of macker. There is a jDepend maven plugin, but it’s functionality is merely generating reports about usage and statistics, but what I really need is something else, an access check which fails the build if it fails.

Can someone suggest a better alternative for project access checks or package access checks for maven projects?

Thanks

  • 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-05-13T08:17:15+00:00Added an answer on May 13, 2026 at 8:17 am

    I think you are looking for banned dependencies from maven-enforcer-plugin.

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>enforce-banned-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <excludes>
                    <exclude>org.apache.maven</exclude>
                    <exclude>org.apache.maven:badArtifact</exclude>
                    <exclude>*:badArtifact</exclude>
                  </excludes>
                  <includes>
                    <!--only 1.0 of badArtifact is allowed-->
                    <include>org.apache.maven:badArtifact:1.0</include>
                  </includes>
                </bannedDependencies>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have imported some projects in eclipse through Maven. I want to access the
I have following Maven projects set up: PM-Core PM-Web (with a dependency to PM-Core)
I have set up my maven project using the m2e plugin in eclipse indigo,
I have a maven project that has a set of library dependancies that are
I'm running Eclipse Indigo on Mac 10.7.4. I have a Maven (3.0.3) project set
I have a big Maven multi-module build set up in my Jenkins. It is
I have set a background on the data-role=page element like so <div data-role=page style=background:
I have set of flat files (114 files) each file is named with database
I have two maven projects: project-api project-impl project-impl's POM specifies a dependency on project-api.
I'm very new to Maven, and have a question about building multiple Maven projects.

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.