maven打包命令

在你們用maven新建項目的時候,每每最後不會打包,下面講解一下打包的命令web

首先咱們必須在pom.xmlw文件配置。日若是你想支持快捷啓動。能夠用apache

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

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

 

<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>

咱們配置這樣的信息,打包的時候只要在項目的目錄下:eclipse

輸入:mvn clean install -DskipTests命令,就能夠了。webapp

 

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

這段代碼是打包,打到那裏去,,那就是咱們父項目中maven

相關文章
相關標籤/搜索