2016-05-16 4 views
3

私はExtjs 6とSpringブートスタックを使って簡単なWebアプリケーションを実装しようとしています。Extjs 6 Sencha CmdとSpring Boot

sencha cmdを使用すると、スタンドアロンのExtjsアプリケーションを作成できます。しかし、私はこのアプリケーションを私のSpring Boot Web Applicationの一部として持つ必要があります。それは春のブートによってWARファイルビルドに追加されるべきです。

私のSpring Webアプリケーション構造はどのようにすべきですか?

sencha cmdとspring bootを併用してビルドする方法は?

これで多くの検索ができましたが、適切な回答が見つかりませんでした。

+0

あなたは[春ブーツ+ angularjs]についてのドキュメントを読みました(https://spring.io/blog/2015/01/12/spring-and-angular-js-a-secure-single-page-application)?私はExtjsを含むどんなスパでも同様の設定が使えると確信しています。 – miensol

+1

これは、extjs 6でまだ完全にサポートされていないwro4jを使用しています。私の質問は、sencha cmdを使用して作成したアプリケーションをSpringブートWebアプリケーションに統合する方法です。または、sencha cmdを使用してextjs uiを持つspringブートWebアプリケーションをコンパイル/パッケージ化する方法。 – Chaitu

+0

あなたはmavenかgradleを使用していますか? –

答えて

0

私たちは一般的に瓶のようにして、瓶の中に入れます。組み込みWebサーバーは、jarファイルの内容を直接提供できます。 Jbossや他のアプリケーションサーバーでWARファイルを使用します。

ランタイムモジュールで

ちょうどあなたの典型的な@SpringBootApplicationを使用して、私は私のMavenのpom.xmlにこれを使用

を引っ張っ: 瓶

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>exec-maven-plugin</artifactId> 
    <version>1.5.0</version> 
    <executions> 
     <execution> 
     <id>sencha-compile</id> 
     <phase>generate-sources</phase> 
     <goals> 
      <goal>exec</goal> 
     </goals> 
     <configuration> 
      <!-- Set path to your Sencha Cmd executable--> 
      <!--<executable>../Sencha/Cmd/6.xxx/sencha</executable>--> 
      <executable>sencha</executable> 
      <workingDirectory>${basedir}/src/main/extjs</workingDirectory> 
      <arguments> 
      <argument>app</argument> 
      <argument>build</argument> 
      <argument>testing</argument> 
      </arguments> 
     </configuration> 
     </execution> 
    </executions> 
    </plugin> 

    <plugin> 
    <artifactId>maven-resources-plugin</artifactId> 
    <version>3.0.1</version> 
    <executions> 
     <execution> 
     <id>copy-resources</id> 
     <!-- here the phase you need --> 
     <!--<phase>package</phase>--> 
     <phase>compile</phase> 
     <goals> 
      <goal>copy-resources</goal> 
     </goals> 
     <configuration> 
      <outputDirectory>${basedir}/target/classes/public</outputDirectory> 
      <resources> 
      <resource> 
       <!-- for production --> 
       <directory>src/main/extjs/build/testing/yourpath</directory> 

       <filtering>false</filtering> 
      </resource> 
      </resources> 
     </configuration> 
     </execution> 
    </executions> 
    </plugin> 

    <plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-clean-plugin</artifactId> 
    <version>2.5</version> 
    <configuration> 
     <filesets> 
     <fileset> 
      <directory>${project.basedir}/src/main/extjs/build</directory> 
      <includes> 
      <include>**/*</include> 
      </includes> 
      <followSymlinks>false</followSymlinks> 
     </fileset> 
     </filesets> 
    </configuration> 
    </plugin> 
+0

私はいくつかのより効率的なビルド戦略を試してみました。しかし、私はこれが誰にとってもうまくいくことを知っています。 –