Code Monkey home page Code Monkey logo

sencha-extjs-maven's Introduction

How to generate ExtJS 5 project with Sencha Cmd 5

At the moment Sencha Cmd 5.1 is out.

  1. Download and install Sencha Cmd 5.1 as described in getting started. Also take a look at the Cmd 5.x docs.

  2. Generate new ExtJS 5.1 application:

    $ sencha generate app -ext MyApp src/main/application

I don't recommend to add "ext" directory with all ExtJS framework files to our Git repository.

How to build ExtJS project with Maven

In order to compile your project from Maven use exec-maven-plugin:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.3.2</version>
    <executions>
        <execution>
            <id>sencha-compile</id>
            <phase>compile</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <!-- Set path to your Sencha Cmd executable-->
                <executable>${env.SENCHA_CMD}</executable>
                <workingDirectory>${project.basedir}/src/main/application</workingDirectory>
                <arguments>
                    <argument>app</argument>
                    <argument>build</argument>
                    <argument>--clean</argument>
                    <argument>--environment</argument>
                    <argument>${sencha.env}</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

And run:

$ export SENCHA_CMD="/path/to/your/Sencha/Cmd/5.1.2.52/sencha"
$ mvn compile

If you want to make SENCHA_CMD permanent then add it to your /etc/profile or ~/.bashrc file.

Note: ${sencha.env} determines your current maven profile: development or production. Take a look at pom.xml. Your compiled ExtJS project will be located at src/main/application/build/production. You may change it to any other location.

How to build WAR

Use maven-war-plugin to package WAR file.

<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/application/build/${sencha.env}/MyApp</directory>
                <excludes>
                    <exclude>**/Readme.md</exclude>
                </excludes>
            </resource>
        </webResources>
    </configuration>
</plugin>

Now you have fully funtional Java web application.

IntelliJ Idea + JRebel + Web module debugging

  1. Create new artifact and add src/main/application folder to it instead of src/main/application/build/testing/MyApp

  2. Configure web server to deploy your newly created artifact.

  3. In rebel.xml change root web folder to src/main/application:

See more info about JRebel configuration:

sencha-extjs-maven's People

Contributors

dobromyslov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.