enforcer-rules | Additional custom rules for Maven enforcer | Plugin library
kandi X-RAY | enforcer-rules Summary
kandi X-RAY | enforcer-rules Summary
Additional custom rules for Maven enforcer. Available extra rules: * [requireDepMgt] - enforces that dependency management is used. * [requireFilesContent] - enforces that the specified list of files exist and are containing the specified content. * [matchGroupIdAndPackage] - enforces a module to contain a package that matches its group id. * [matchArtifactIdAndBaseDir] - enforces that the pom’s artifact id and the base directory name are the same. For more sample usages, refer to integration test scenarios in src/it folder. [requireDepMgt]: [requireFilesCOntent]: [matchGroupIdAndPackage]: [matchArtifactIdAndBaseDir]:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Runs the rules
- Checks the given file
- Checks the given condition
- Validates that the reference is not null
- Main entry point
- Gets dependency map
- Apply the difference between baseDir and baseDir
- Gets the Maven project
- Check if there is a Java package for the specified groupId
- Get the cache id
enforcer-rules Key Features
enforcer-rules Examples and Code Snippets
Community Discussions
Trending Discussions on enforcer-rules
QUESTION
I´m using enforcer
plugin in a multi-node project in the root pom, but I have one testing module, that I dont really care to run the plugin there since it wont create any jar and is only for testing propuse. Is there any way to skip one of the modules in the plugin config?.
Checking the documentation I cannot find anything. Only how to ban some specific dependencies. https://maven.apache.org/enforcer/enforcer-rules/bannedDependencies.html
The solution to put the plugin in each sub-module is possible but it's dangerous, since if I create a new sub-module I might forget to add it there
Here my plugin config.
...ANSWER
Answered 2020-May-21 at 19:49In the POM of the module, set enforcer.skip
to true
:
QUESTION
Consider a very common situation when a project depends on 2 libraries, each transitively bringing a 3rd library of different versions:
...ANSWER
Answered 2020-May-07 at 12:52No, as khmarbaise already said, this is not possible.
The resolution rule sits deeply in Maven itself. You can check the result of the resolution (as you already mentioned), but you cannot change it.
We decided to fix nearly all the versions of transitive dependencies by using appropriate BOMs (lists of dependencyManagement) that we import
in the section. This guarantees that all dependencies come in recent versions. It does not guarantee that everything fits together. But using the newest version as standard would not do that either.
QUESTION
For example, the licensing might expire soon and we want to enforce everyone to find an alternative. Another example is when it is known then that a library is not secure (thus, some alternative library has to be used).
I have read this documentation: https://maven.apache.org/enforcer/enforcer-rules/bannedDependencies.html
What I meant is if there is a way to validate artifacts of a project against a remote (internal-company) server somewhere to see if any of the artifacts are banned or not.
...ANSWER
Answered 2020-Mar-18 at 11:51JFrog Xray allows you to filter for their security lists as well as to blacklist/whitelist other artifacts (with your own custom messages).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install enforcer-rules
You can use enforcer-rules like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the enforcer-rules component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page