maven打包命令


在大家用maven新建项目的时候,往往最后不会打包,下面讲解一下打包的命令

首先我们必须在pom.xmlw文件配置。日如果你想支持快捷启动。可以用

<build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
            </plugin>
        </plugins>
        
        <finalName>pay</finalName>
    </build>

这是支持jetty容器的插件配置。

 

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>install</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeScope>provided</includeScope>
                            <outputDirectory>${jarToDir}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>copy-jar</id>
                        <phase>install</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${jarToDir}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

我们配置这样的信息,打包的时候只要在项目的目录下:

输入:mvn clean install -DskipTests命令,就可以了。

 

    <properties>
        <local.repo>${project.basedir}/../../</local.repo>
        <jarToDir>../../pay-platform/src/main/webapp/WEB-INF/lib-channels/sfjpay</jarToDir>
    </properties>

这段代码是打包,打到那里去,,那就是我们父项目中

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM