首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >生产部门使用Joinfaces构建JHipster。如何指定在何处查找xhtml文件

生产部门使用Joinfaces构建JHipster。如何指定在何处查找xhtml文件
EN

Stack Overflow用户
提问于 2017-08-12 09:08:40
回答 1查看 368关注 0票数 0

我刚刚开始将JoinFaces集成到JHipster中,这非常容易。

遵循JoinFaces的示例,我将xhtml文件放到src/resources/META/resources中。

正常构建,如mvn -Pdev spring:运行没有任何问题的运行。

我只是在拼图中的最后一块挣扎,生产建造。如上所述,xhtml文件存储在src/resources/META/resources中。在生产生成mvn -Pprod包之后,它们位于/WEB/classes/META/-Pprod/ war中。

运行应用程序会导致状态: Not (未找到)消息:在http://localhost:8080/index.jsf中未找到

我要怎么解决这个问题?我真的不知道这款“嬉皮士”的春季引导应用程序会在哪里。然后,我可以相应地调整pom (考虑maven资源插件)。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-13 23:01:04

为什么不反过来呢?把它们放在JSF可以找到它们的位置?

好主意。因此,更多地使用它,我发现jhipster在进入Maven包阶段时,期望html文件位于target/www/中。我用的是maven资源插件。

对pom.xml做了以下调整:

代码语言:javascript
复制
<profiles>
    <profile>
        <id>prod</id>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-undertow</artifactId>
            </dependency>
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                    <executions>
                        <execution>
                            <id>copy-resources</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${basedir}/target/www/</outputDirectory>
                                <resources>
                                    <resource>
                                        <directory>src/main/resources/META-INF/resources/</directory>
                                        <filtering>false</filtering>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

我也把src/main/resources/排除在声纳之外

代码语言:javascript
复制
<sonar.exclusions>src/main/webapp/content/**/*.*, src/main/webapp/bower_components/**/*.*,src/main/resources/META-INF/**/*.*,
        src/main/webapp/i18n/*.js, target/www/**/*.*
</sonar.exclusions>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45648516

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档