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>
  • 相关阅读:
    C\C++\Java字符串拼接比较
    Visual Assist X支持VS2010高亮显示CUDA代码(Windows 7)
    相似字符串(编程之美2013初赛题2)
    linux mdadm raid阵列重建加速bitmaps文件
    Pig Grunt之简单命令及实例说明
    error: device not found解决
    Spring配置文件错误
    Java贪吃蛇游戏(坐标方法)
    java增强型for循环(三种遍历集合方式)
    酸菜鱼的简单做法
  • 原文地址:https://www.cnblogs.com/junneyang/p/9117595.html
Copyright © 2011-2022 走看看