[ 
https://issues.apache.org/jira/browse/MENFORCER-348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Scholte closed MENFORCER-348.
------------------------------------
      Assignee: Robert Scholte
    Resolution: Won't Fix

The rules we maintain should be scoped to things all projects have: OS, JDK, 
Maven and the pom. This proposal is too specific and should be written as a 
custom rule 
(https://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html).

> add a graalvm enforcer rule
> ---------------------------
>
>                 Key: MENFORCER-348
>                 URL: https://issues.apache.org/jira/browse/MENFORCER-348
>             Project: Maven Enforcer Plugin
>          Issue Type: New Feature
>          Components: Standard Rules
>            Reporter: Ian Springer
>            Assignee: Robert Scholte
>            Priority: Major
>
> Our project relies on the GraalVM. We currently have a gmavenplus-plugin 
> snippet that enforces 1) that the build JDK is GraalVM, and 2) that it has 
> the required version. It looks like this:
>  
> {code:java}
> <script><![CDATA[
>     import org.apache.tools.ant.BuildLogger
>     import org.apache.tools.ant.types.LogLevel
>     def currentProjectDir = new File("${basedir}")
>     def javaVmName = System.properties['java.vm.name']
>     def vmVersion = "${java.vm.version}".tokenize("-")
>     def runtimeVer = "${java.runtime.version}".tokenize(".")
>     def graalVersion = "${graal.version}";
>     if (graalVersion.reverse().take(1) == "0") {
>         graalVersion = graalVersion.substring(0, graalVersion.length() - 2)
>     }
>     if (!(javaVmName =~ "GraalVM") && !(runtimeVer.contains("graal"))) {
>         ant.fail "Build JVM is not GraalVM."
>     }
>     if (!javaVmName.endsWith("${graal.version}") && 
> !(vmVersion.contains(graalVersion))) {
>         ant.fail "GraalVM version is not ${graal.version}. Found ${vmVersion} 
> instead."
>     }
>     print "Build JVM: ${javaVmName}\n"
> ]]>
> </script>
> {code}
>  
> It would be great if the enforcer plugin had a builtin rule for this that 
> looked like this:
>  
> {code:java}
> <requireGraalVmVersion> 
>     <version>19.3.1</version>
> </requireGraalVmVersion>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to