allegro / grunt-maven-plugin

Grunt + Maven integration done right
Other
213 stars 32 forks source link

target-grunt exceeds deploy size 300MBs on Heroku #62

Closed dbclkclk closed 9 years ago

dbclkclk commented 9 years ago

Is there a way to delete this directory after the build before getting deployed?

adamdubiel commented 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>
dbclkclk commented 9 years ago

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.

adamdubiel commented 9 years ago

Okay, i will try to see it now.

adamdubiel commented 9 years ago

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
dbclkclk commented 9 years ago

@adamdubiel OK is there a way in pom.xml I can specify maven to run

 grunt:clean

After the install phase?

adamdubiel commented 9 years ago

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 :)

adamdubiel commented 9 years ago

I will close this issue, reopen it if you need more info.