You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by zebahmad <co...@gmail.com> on 2012/03/29 16:25:03 UTC
Selective repo purge after clean install
I have a parent pom with a module that assembles from 3 other modules.
ParentA
---| ModuleB
---| AssembledModuleC (depends on ModuleC1,ModuleC2,ModuleC3)
---| ModuleC1
---| ModuleC2
---| ModuleC3
---| ModuleD (depends on ModuleC1)
When I invoke clean install on ParentA from Jenkins, it installs all the
modules onto my local maven repository. However at the end of this, I want
to remove ModuleC1, ModuleC2 and ModuleC3, since there is another script
which picks up *all* the built jars and uploads to the repo and performs
other custom actions( The C1,C2,C3 modules are not to be exposed for use in
the repo)
How can I accomplish this? I tried the following ways but failed
1) Use maven-clean-plugin ==> Unfortunately this seems to remove only from
the project directory & is not useful for deleting from the local maven repo
2) Use maven-install-plugin to skip install for specific projects ==>
Unfortunately ModuleC1,ModuleC2 & ModuleC3 are dependencies of
AssembledModuleC and hence the build will fail.
3) Use maven-dependency-plugin with purge-local-repository goal in install
phase. I tried adding this to the pom of ParentModuleA.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>purge-repository</id>
<phase>install</phase>
<goals>
<goal>purge-local-repository</goal>
</goals>
<configuration>
<actTransitively>false</actTransitively>
<includeGroupIds>com.mycompany.something</includeGroupIds>
<excludeArtifactIds>ModuleB,AssembledModuleC,ModuleD</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
Unfortunately, ModuleD depends on ModuleC1 and hence the build fails during
compile of ModuleD.
Could you suggest what is the right way to accomplish this?
Thanks,
Zeba
--
View this message in context: http://maven.40175.n5.nabble.com/Selective-repo-purge-after-clean-install-tp5603961p5603961.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Selective repo purge after clean install
Posted by zebahmad <co...@gmail.com>.
Thank you for the reply Wayne! I will try modifying the plugin for my use. I
just wanted to ensure I wasn't re-inventing the wheel.
Thanks,
Zeba
--
View this message in context: http://maven.40175.n5.nabble.com/Selective-repo-purge-after-clean-install-tp5603961p5606133.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Selective repo purge after clean install
Posted by Wayne Fay <wa...@gmail.com>.
> to remove ModuleC1, ModuleC2 and ModuleC3, since there is another script
> which picks up *all* the built jars and uploads to the repo and performs
> other custom actions( The C1,C2,C3 modules are not to be exposed for use in
> the repo)
Change the script so it does not pick up *all* the built jars but only
a subset of them. Or write your own plugin (perhaps adapt the
purge-local-repository plugin) to handle this specific case.
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org