Can I use Maven with Sencha Cmd instead of Ant, or must it use Ant?
ant, extjs, maven, sencha-cmd
Solution
You can build your Sencha ExtJS project with Maven using Sencha CMD. It's rather easy. Check my example project Sencha ExtJS 5 + Sencha Cmd 5 + Maven:
https://github.com/dobromyslov/sencha-extjs-maven
Sencha ExtJS 5.0 BETA available at the moment. Read Sencha CMD docs and try it in action.
Then just put your project in the `webapp` folder and use `exec-maven-plugin` to build your ExtJS application with Sencha CMD like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>sencha-compile</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<!-- Set path to your Sencha Cmd executable-->
<executable>../Sencha/Cmd/5.0.0.116/sencha</executable>
<arguments>
<argument>-sdk</argument>
<argument>${basedir}/src/main/webapp</argument>
<argument>app</argument>
<argument>build</argument>
<argument>--clean</argument>
<argument>--environment</argument>
<argument>${sencha.env}</argument>
<argument>--destination</argument>
<argument>${basedir}/src/main/webapp/build</argument>
</arguments>
</configuration>
</execution>
</executions>
If you want to purge unnecessary files from the resulting WAR file then use `maven-war-plugin` with configured exclusions like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>src/main/webapp/build/${sencha.env}/MyApp</directory>
<excludes>
<exclude>**/Readme.md</exclude>
</excludes>
</resource>
</webResources>
<packagingExcludes>.sencha/**,app/**,build/**,ext/**,overrides/**,packages/**,sass/**,bootstrap.css,bootstrap.js,bootstrap.json,build.xml,Readme.md</packagingExcludes>
</configuration>
Problem
We are making changes to use Sencha Cmd, but it uses Ant. We use Maven for other things, so can we make changes to a config file or something, so Sencha Cmd uses Maven not Ant, or must we have Ant installed to use Sencha Cmd. Thanks in advance.