中文字幕精品亚洲无线码二区,国产黄a三级三级三级看三级,亚洲七七久久桃花影院,丰满少妇被猛烈进入,国产小视频在线观看网站

maven編譯后(hou)復制到目標位置

maven對項(xiang)(xiang)目(mu)進行打包(bao)之后(hou),可以將打包(bao)好的jar和某些資(zi)源(yuan)文件(jian)復制到指定位置,例如你的項(xiang)(xiang)目(mu)結構(gou)是services父(fu)項(xiang)(xiang)目(mu)下有個(ge)子項(xiang)(xiang)目(mu),service-1,它在打包(bao)之后(hou),希望把jar和templates文件(jian)夾(jia)復制到父(fu)項(xiang)(xiang)目(mu)services的target目(mu)錄,這就可以使(shi)用maven的兩個(ge)插件(jian)來(lai)完成。

maven-dependency-plugin

編譯之后(hou),將當(dang)前項目的(de)jar復(fu)制到某個目錄下

 <plugin>
    <artifactId>maven-dependency-plugin</artifactId>
     <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>copy</goal>
                </goals>
                <configuration>
                    <artifactItems>
                        <artifactItem>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>${project.artifactId}</artifactId>
                            <version>${project.version}</version>
                        </artifactItem>
                    </artifactItems>
                    <outputDirectory>../target</outputDirectory>
                    <stripClassifier>true</stripClassifier>
                    <stripVersion>true</stripVersion>
                </configuration>
            </execution>
     </executions>
</plugin>

maven-resources-plugin

將資源目錄(lu)resources下的某些(xie)文件,復(fu)制到上一級目錄(lu)的templates下

<plugin>
 <artifactId>maven-resources-plugin</artifactId>
    <version>2.7</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>../target/templates</outputDirectory>
                <resources>
                    <resource>
                        <directory>${basedir}/templates</directory>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>

這(zhe)兩個(ge)插件(jian)在多(duo)級項目(mu)中,使用的很(hen)多(duo),比如,你的多(duo)層項目(mu)都是一(yi)個(ge)SPI,這(zhe)些SPI放(fang)在一(yi)起打一(yi)下鏡像,對外(wai)提供服務,你就(jiu)可以使用這(zhe)兩個(ge)插件(jian)來(lai)將它(ta)們的jar輸出到父(fu)目(mu)錄下。

posted @ 2021-11-02 11:29  張占嶺  閱讀(1219)  評論(0)    收藏  舉報