gpt4 book ai didi

Extjs 6 Sencha Cmd 和 Spring Boot

转载 作者:行者123 更新时间:2023-12-02 04:41:17 24 4
gpt4 key购买 nike

我正在尝试使用 Extjs 6 和 Spring 引导堆栈实现简单的 Web 应用程序。

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

我的 spring web 应用程序结构应该如何?

如何同时使用sencha cmd和spring boot来构建?

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

最佳答案

使用 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>

关于Extjs 6 Sencha Cmd 和 Spring Boot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37249563/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com