Is there a way to update default-bindings.xml for maven on local

前端 未结 2 722
青春惊慌失措
青春惊慌失措 2021-01-16 08:52

It could sound dumb. But is there a way to edit or update the default-bindings file of maven?

/META-INF/plexus/default-bindings.xml

相关标签:
2条回答
  • 2021-01-16 09:15

    Looks like you want to override the version the override the version of maven-surefire-plugin wihtout modifying any project' specific pom.xml file . To achieve this you need to extend your local installation of maven. Maven have concept of super pom and pom (without parent) is extended from it implicitly.

    Since you neither have parent pom nor want to modify all of project's pom, only option left seems to override the default super pom. I am not sure if overriding binding can help too or not. But you should be able to override the super pom by following steps to meet your needs.

    1) Create a super pom file (pom-4.0.0.xml) by copying the default pom file (directory content for maven 3.x version):

    \---org
        \---apache
            \---maven
                \---model
                        pom-4.0.0.xml 
    

    2) Add entry for maven-surefire-plugin with required version as shown in sniped below.

     ...
    <pluginManagement>
     ...
     <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19</version>
      </plugin> 
      </plugins>
    </pluginManagement>
    ...
    

    3) Create a jar, say mycompany.superpom.jar packaging your pom file.

    jar -cf mycompany.superpom.jar .
    

    4) Place the jar under $MAVEN_HOME\lib\ext directory.

    5) You should be done. All your project will be using maven-surefire-plugin with specified version.

    Hope this helps.

    0 讨论(0)
  • 2021-01-16 09:21

    That file is inside the jar:

    ${MAVEN}/lib/maven-core-3.3.9.jar
    

    So:

    ${MAVEN}/lib/maven-core-3.3.9/META-INF/plexus/default-bindings.xml
    
    0 讨论(0)
提交回复
热议问题