Maven分享资源

时间:2018-10-04 04:25:29

标签: java maven tomcat

我使用“ maven-remote-resources-plugin”共享资源

但是,现在将文件放在“ web-inf”文件夹中,

我知道,“ web-inf”无法访问。

如何将文件放入src / main / webapp文件夹?



子女父母POM
enter image description here

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.5</version>
<configuration>
    <resourceBundles>
        <resourceBundle>test:a-resources:${project.version}</resourceBundle>
    </resourceBundles>
    <outputdirectory>/</outputdirectory>
</configuration>
<executions>
    <execution>
        <goals>
            <goal>process</goal>
        </goals>
    </execution>
</executions>

孩子A POM
enter image description here

<plugins>
<plugin>
    <artifactId>maven-remote-resources-plugin</artifactId>
    <version>1.5</version>
    <executions>
        <execution>
            <goals>
                <goal>bundle</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <resourcesDirectory>${project.build.outputDirectory}</resourcesDirectory>
        <includes>
            <include>**/*.json</include>
        </includes>
    </configuration>
</plugin>

父级(网络应用程序)

src / main / webapp

子级A(存储html,js,css文件)

-页面
--index.html

子B(存储Java类文件)

---java.class

0 个答案:

没有答案