You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benjamin Marwell <bm...@apache.org> on 2020/11/27 09:29:51 UTC

[MAVEN-ALL] Restrict imports or API usage by enforcer plugins / other plugins

Hello everyone,

MJLINK-PR19 [1] removes some plexus imports.
In the PR discussion the idea came up to add an enforcer rule to this
or even other plugins which forbids imports, e.g. to plexus.

There is also a weaker version, the forbidden-api checker [2] can
check for specific method calls, e.g. just a specific method call
(even like Optional::get).

The next stricter rule would be to add an enforcer rule to disallow
certain dependencies, like plexus-utils.

As suggested in [1], is this something which could/should be applied
to all plugins?

Regards,
Ben

[1] https://github.com/apache/maven-jlink-plugin/pull/19
[2] https://github.com/policeman-tools/forbidden-apis

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [MAVEN-ALL] Restrict imports or API usage by enforcer plugins / other plugins

Posted by Sandra Parsick <sp...@web.de>.
Thanks, Ben, for the email.

I would like to add, that such automatic check would make it easier for
newbie contributor like me to follow code standard of the project.

Regards,

Sandra

Am 27.11.20 um 10:29 schrieb Benjamin Marwell:
> Hello everyone,
> 
> MJLINK-PR19 [1] removes some plexus imports.
> In the PR discussion the idea came up to add an enforcer rule to this
> or even other plugins which forbids imports, e.g. to plexus.
> 
> There is also a weaker version, the forbidden-api checker [2] can
> check for specific method calls, e.g. just a specific method call
> (even like Optional::get).
> 
> The next stricter rule would be to add an enforcer rule to disallow
> certain dependencies, like plexus-utils.
> 
> As suggested in [1], is this something which could/should be applied
> to all plugins?
> 
> Regards,
> Ben
> 
> [1] https://github.com/apache/maven-jlink-plugin/pull/19
> [2] https://github.com/policeman-tools/forbidden-apis
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>