Closed dbclkclk closed 9 years ago
Yes, you can use clean
target from grunt-maven to achieve this.
Either call
mvn grunt:clean
after build or add it to your configuration for deployment profile:
<execution>
<goals>
<goal>create-resources</goal>
<goal>npm</goal>
<goal>bower</goal>
<goal>grunt</goal>
<goal>clean</goal>
</goals>
</execution>
Yep added that @adamdubiel however, running
mvn install
With the following configuration:
<executions>
<execution>
<goals>
<goal>create-resources</goal>
<goal>npm</goal>
<!-- or npm-offline if npm failure is not an option -->
<goal>bower</goal>
<goal>grunt</goal>
<goal>clean</goal>
</goals>
</execution>
</executions>
Doesn't remove the directory. I tried this locally however, it doesn't work.
Okay, i will try to see it now.
It doesn't work due to Maven lifecycle mapping - clean
commands reside in entirely different lifecycle and so it is not run during default
lifecycle. But you can make it work by running multiple targets at once:
mvn install grunt:clean
@adamdubiel OK is there a way in pom.xml I can specify maven to run
grunt:clean
After the install phase?
I guess you could add another execution of grunt in clean
phase (or any other phase), i.e:
<executions>
<execution>
<goals>
<goal>create-resources</goal>
<goal>npm</goal>
<goal>grunt</goal>
</goals>
</execution>
<execution>
<id>clean-grunt</id>
<phase>install</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
Experiment with maven, i don't know your exact setup :)
I will close this issue, reopen it if you need more info.
Is there a way to delete this directory after the build before getting deployed?