dependencies - Removing maven dependancies of child pom from parent pom -
My parents are Pom A with POM, B, C and D with children in I, B, C and D, I have dependency with the same type
i.e. parent
& lt; artifactID & gt; Blah & lt; / ArtifactID & gt; & Lt; Module & gt; & Lt; Module & gt; B & lt; / Module & gt; & Lt; Module & gt; C & lt; / Module & gt; & Lt; Module & gt; D & lt; / Module & gt; & Lt; / Module & gt; Kid POM
& gt; Dependency & gt; & Lt; Dependency & gt; . . & Lt; Scope & gt; Trial & lt; / Scope & gt; & Lt; Type & gt; Test-jar & lt; / Type & gt; & Lt; / Dependencies & gt; & Lt; / Dependencies & gt; So far I have tried to make the plug-in accurate and that does not work when trying to exclude the test scope for child poms.
My question is to exclude all dependencies with type paste-jars for all children is a way to add a profile to parent palm thanks
Since you are trying to update the path in the test field, you can hook maven-surfire- plugin which is actually responsible for creating test roompaths and removing unwanted dependencies or adding new ones. Therefore, if you want to apply this restriction to each module you can enter the child for poms, eg For B : & lt; Project & gt; ... & lt; ArtifactId & gt; B & lt; / ArtifactId> ... & lt; Build & gt; & Lt; Plugins & gt; & Lt; Plugin & gt; & Lt; Group & gt; Org.apache.maven.plugins & lt; / Group & gt; & Lt; ArtifactId & gt; Maven- Perfect-plugin & lt; / ArtifactId> & Lt; Version & gt; 2.17 & lt; / Edition & gt; & Lt; Configuration & gt; & Lt; classpathDependencyExcludes & gt; & Lt; classpathDependencyExclude & gt; $ {Unwanted-Dependency-Group}: $ {Unwanted-dependency-artifactId} & lt; / classpathDependencyExclude & gt; & Lt; / classpathDependencyExcludes & gt; & Lt; / Configuration & gt; & Lt; / Plugin & gt; & Lt; / Plugins & gt; & Lt; / Create & gt; ... & lt; / Project & gt; Or if you want to get this restriction inherited by all the child modules , then define a profile based plugin in parent palm: < / P> & lt; Project & gt; ... & lt; ArtifactId & gt; A & lt; / ArtifactId> & Lt; Module & gt; B & lt; / Module & gt; & Lt; Module & gt; C & lt; / Module & gt; & Lt; Module & gt; D & lt; / Module & gt; ... & lt; Profile & gt; & Lt; Profile & gt; & Lt; ID & gt; Custom Test Goal & lt; / Id & gt; & Lt; Construction & gt; & Lt; Plugins & gt; & Lt; Plugin & gt; & Lt; Group & gt; Org.apache.maven.plugins & lt; / Group & gt; & Lt; ArtifactId & gt; Maven- Perfect-plugin & lt; / ArtifactId> & Lt; Version & gt; 2.17 & lt; / Edition & gt; & Lt; Configuration & gt; & Lt; classpathDependencyExcludes & gt; & Lt; classpathDependencyExclude & gt; $ {Unwanted-Dependency-Group}: $ {Unwanted-dependency-artifactId} & lt; / classpathDependencyExclude & gt; & Lt; / classpathDependencyExcludes & gt; & Lt; / Configuration & gt; & Lt; / Plugin & gt; & Lt; / Plugins & gt; & Lt; / Create & gt; & Lt; / Profile & gt; & Lt; / Profile & gt; ... & lt; / Project & gt;
Comments
Post a Comment