我刚刚开始将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资源插件)。
发布于 2017-08-13 23:01:04
为什么不反过来呢?把它们放在JSF可以找到它们的位置?
好主意。因此,更多地使用它,我发现jhipster在进入Maven包阶段时,期望html文件位于target/www/中。我用的是maven资源插件。
对pom.xml做了以下调整:
<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/排除在声纳之外
<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>https://stackoverflow.com/questions/45648516
复制相似问题