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/28 16:35:37 UTC

maven-clean-plugin to clean up dependencies in assembly project

I have a maven project with a parent pom that builds the child modules. One
of the child modules is an assembly project that simply assembles other
child modules

ParentA
   |---ModuleA
   |---AssembledModuleB
	|---ModuleB1
	|---ModuleB2
   |---ModuleC

Here, ParentA only contains a pom that simply builds ModuleA,
AssembledModuleB & ModuleC. ModuleB1 & ModuleB2 are separate projects on
which AssembledModuleB depends. 

Firstly, after the build, I need to clean up the jars ModuleB1.jar and
ModuleB2.jar and retain only the composite jar AssembledModuleB.jar. I tried
using the maven-clean-plugin, but no matter what combination I try, these
don't get deleted :( 

<plugin>
	<artifactId>maven-clean-plugin</artifactId>
		<version>2.4.1</version>
		<configuration>
		<filesets>
			<fileset>
				<directory>target</directory>
				<includes> 
					<include>*.jar</include> 
				</includes> 
				<excludes>
					<exclude>ModuleA.jar</exclude>
					<exclude>AssembledModuleB.jar</exclude>
					<exclude>ModuleC.jar</exclude>
				</excludes>
				<followSymlinks>false</followSymlinks>
			</fileset>
		</filesets>
	</configuration>
</plugin>

I have tried various options such as

<include>*:jar</include> 

<include><..groupid..>:jar</include> 

<exclude>com.mycompany.somthing:ModuleA:jar</exclude>

But none of these seem to work :( The aim is to delete the built jars from
the target folders of ModuleB1 and ModuleB2

Secondly, i need to ensure that the plugin is called *after* the build is
completed.

Thanks in advance,

Regards
Zeba

--
View this message in context: http://maven.40175.n5.nabble.com/maven-clean-plugin-to-clean-up-dependencies-in-assembly-project-tp5600724p5600724.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: maven-clean-plugin to clean up dependencies in assembly project

Posted by zebahmad <co...@gmail.com>.
It looks like the default directory clean was responsible for removing all
the jars. It works now, after adding this:

 <configuration>
                       
<excludeDefaultDirectories>true</excludeDefaultDirectories>
.
.
.
.
</configuration>

Thanks,
Zeba

--
View this message in context: http://maven.40175.n5.nabble.com/maven-clean-plugin-to-clean-up-dependencies-in-assembly-project-tp5600724p5602455.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: maven-clean-plugin to clean up dependencies in assembly project

Posted by zebahmad <co...@gmail.com>.
Yeah, doesn't work :(

Thanks,
Zeba

--
View this message in context: http://maven.40175.n5.nabble.com/maven-clean-plugin-to-clean-up-dependencies-in-assembly-project-tp5600724p5602388.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: maven-clean-plugin to clean up dependencies in assembly project

Posted by Wayne Fay <wa...@gmail.com>.
> Actually, I'm able to delete the jars now. But the exclude is not working
> still :( My plugin configuration in pom.xml is:

Did you try removing the <include> and just using the <exclude>?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven-clean-plugin to clean up dependencies in assembly project

Posted by zebahmad <co...@gmail.com>.
Actually, I'm able to delete the jars now. But the exclude is not working
still :( My plugin configuration in pom.xml is:

<plugin>
	<artifactId>maven-clean-plugin</artifactId>
	<version>2.4.1</version>
	<executions>
		<execution>
			<id>auto-clean</id>
			<phase>install</phase>
			<goals>
				<goal>clean</goal>
			</goals>
			<configuration>
				<filesets>
					<fileset>
						<directory>target</directory>
						<includes>
							<include>*.jar</include>
						</includes>
						<excludes>
							<exclude>com.mycompany.something:ModuleA.jar</exclude>
							<exclude>com.mycompany.something:AssembledModuleB.jar</exclude>
							<exclude>com.mycompany.something:ModuleC.jar</exclude>
						</excludes>
						<followSymlinks>false</followSymlinks>
					</fileset>
				</filesets>
			</configuration>
		</execution>
	</executions>
</plugin>

Thanks,
Zeba

--
View this message in context: http://maven.40175.n5.nabble.com/maven-clean-plugin-to-clean-up-dependencies-in-assembly-project-tp5600724p5600969.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