0

jacoco-maven-plugin uses maven-reporting-impl. Maven-reporting-impl uses doxia. I need to replace doxia with the latest version. I tried the below pom.xml configuration. But it's not packaging the latest version. Are there any other ways to achieve this? I can't replace Maven-reporting-impl version as there are some compilation issues.

Approach 1:

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.8.5</version>
    <dependencies>                    
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-sink-api</artifactId>
                        <version>1.9</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-core</artifactId>
                        <version>1.9</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-site-renderer</artifactId>
                        <version>1.9</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.reporting</groupId>
                        <artifactId>maven-reporting-impl</artifactId>
                        <version>2.1</version>
                        <exclusions>
                            <exclusion>
                                <groupId>org.apache.maven.doxia</groupId>
                                <artifactId>doxia-sink-api</artifactId>
                            </exclusion>
                            <exclusion>
                                <groupId>org.apache.maven.doxia</groupId>
                                <artifactId>doxia-core</artifactId>
                            </exclusion>
                            <exclusion>
                                <groupId>org.apache.maven.doxia</groupId>
                                <artifactId>doxia-site-renderer</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
    </dependencies>   
</plugin>

Approach 2:

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.8.5</version>
    <dependencies>                    
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-sink-api</artifactId>
                        <version>1.9</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-core</artifactId>
                        <version>1.9</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-site-renderer</artifactId>
                        <version>1.9</version>
                    </dependency>                    
    </dependencies>   
</plugin>

Guru
  • 53
  • 6
  • this thread might help: https://stackoverflow.com/questions/3937195/maven-how-to-override-the-dependency-added-by-a-library – sudipn Nov 28 '19 at 08:17
  • Your approaches seem fine. What exactly went wrong? – J Fabian Meier Nov 28 '19 at 10:55
  • doxia jar was pointing to the default jar shipped with jacoco-maven-plugin. It wasn't replacing with the version mentioned explicitly by me in the pom.xml. – Guru Nov 28 '19 at 11:31
  • How did you find that out? – J Fabian Meier Nov 28 '19 at 11:46
  • Thanks for helping out. When I extract the Spring uber jar, it has only the old jars – Guru Nov 28 '19 at 13:30
  • I was wrong. jacoco-maven-plugin was mentioned as a dependency in pom.xml. After removing that, spring boot maven plugin didn't copy any of the plugin related jars inside the uber jar. – Guru Dec 07 '19 at 03:05

0 Answers0