Extjs 6 Sencha Cmd和Spring Boot

问题描述 投票:3回答:1

我试图用Extjs 6 - 和Spring启动堆栈实现简单的Web应用程序。

使用sencha cmd,我们可以创建独立的Extjs应用程序。但我需要将此应用程序作为Spring Boot Web Application的一部分。它应该通过spring boot添加到WAR文件构建中。

我的Spring Web应用程序结构应该如何?

如何使用sencha cmd和spring boot一起构建?

在此搜索了很多,但找不到合适的答案。

extjs spring-boot sencha-cmd
1个回答
0
投票

使用Spring Boot,我们现在通常以jar的方式执行操作并将它们打包到jar中。嵌入式Web服务器可以直接从jar中提供内容。您可以将WAR文件与Jboss或其他应用程序服务器一起使用。

在运行时模块中,只需使用典型的@SpringBootApplication并拉取

我在我的maven pom.xml:jar中使用它

  <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>
© www.soinside.com 2019 - 2024. All rights reserved.