zoukankan      html  css  js  c++  java
  • 【Java】maven多项目资源共享

    方案一:

    <resources>
                <resource>
                    <!-- <directory>${project.parent.relativePath}/../../config</directory> -->
                    <directory>${basedir}/../../config</directory>
                    <includes>
                        <include>**/*.xml</include>
                        <include>**/*.txt</include>
                        <!-- <include>**/*.config</include>
                        <include>key/*.*</include> -->
                    </includes>
                    <!-- <targetPath>resources</targetPath> -->
                </resource>
                <resource>
                    <directory>src/main/resources</directory>
                    <!-- <include>**/*.xml</include>
                    <filtering>true</filtering> -->
                </resource>
            </resources>

    方案二:

    资源端:
    <!-- https://stackoverflow.com/questions/2362652/excluding-classes-in-maven-checkstyle-plugin-reports -->
                    <!-- https://stackoverflow.com/questions/14117709/configuring-maven-to-generate-output-outside-the-project-directory -->
                    <!-- https://blog.sonatype.com/2008/04/how-to-share-resources-across-projects-in-maven/ -->
                    <!-- http://maven.apache.org/plugins/maven-remote-resources-plugin/examples/sharing-resources.html -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-remote-resources-plugin</artifactId>
                        <version>${maven-remote-resources-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>bundle</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <includes>
                                <include>**/*</include>
                            </includes>
                        </configuration>
                    </plugin>
    引用端:
    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-remote-resources-plugin</artifactId>
                        <version>${maven-remote-resources-plugin.version}</version>
                        <configuration>
                            <resourceBundles>
                                <resourceBundle>com.laplace:laplace:${project.version}</resourceBundle>
                            </resourceBundles>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
  • 相关阅读:
    实验吧(你真的会PHP吗)CTF之代码审计最终版---解析是错的 我的才是对的
    php的intval函数
    memcached 查看所有的key
    kvm 启动libvirtd时出现错误
    mysql三种binlog日志的理解
    mysql连接提示1030
    执行curl -sSL 提示curl: (35) SSL connect error
    tomcat线程数查看
    docker 1.12.3版本搭建私有仓库,上传镜像报错:server gave HTTP response to HTTPS client”
    memcached安装
  • 原文地址:https://www.cnblogs.com/junneyang/p/9117595.html
Copyright © 2011-2022 走看看