vandmo / dependency-lock-maven-plugin

Maven plugin that makes sure that Maven dependency are not accidentaly changed.
https://github.com/vandmo/dependency-lock-maven-plugin
Apache License 2.0
65 stars 10 forks source link

Exclusion of a dependency from version and integrity check is not working #68

Closed chrisb2 closed 1 year ago

chrisb2 commented 1 year ago

I am trying to exclude an internal dependency for the check. I have the following configuration in my pom, however mvn se.vandmo:dependency-lock-maven-plugin:check fails with "wrong integrity and version". The internal dependency is in the lock file. Have I got my configuration wrong?

            <plugin>
                <groupId>se.vandmo</groupId>
                <artifactId>dependency-lock-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <dependencySets>
                        <dependencySet>
                            <excludes>
                                <exclude>xxx.yyyy:*</exclude>
                            </excludes>
                            <version>ignore</version>
                            <integrity>ignore</integrity>
                        </dependencySet>
                    </dependencySets>
                </configuration>
                <executions>
                    <execution>
                        <id>check</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
chrisb2 commented 1 year ago

I worked this out. I was thinking that <excludes> ment excluded from the check, but it means excluded from the dependency set, so what is actually required is <includes>:

                <configuration>
                    <dependencySets>
                        <dependencySet>
                            <includes>
                                <include>xxx.yyyy:*</include>
                            </includes>
                            <version>ignore</version>
                            <integrity>ignore</integrity>
                        </dependencySet>
                    </dependencySets>
                </configuration>