簡體   English   中英

Maven發布插件Maven 2

[英]Maven release plugin maven 2

我有多模塊項目,例如在父pom上定義了以下模塊:

<modules>
    <module>child1</module>
    <module>child2</module>
</modules>

當我在父項目mvn release:prepare上鍵入內容時,它將構建每個子項,並最終構建自身。 有沒有辦法告訴發布插件安裝每個孩子? 因此,當我鍵入mvn release:prepare為每個孩子mvn release:prepare它:構建安裝,並在最終版本中?

父pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.voncuver</groupId>
<artifactId>cu</artifactId>
<packaging>pom</packaging>
<version>1.6.1-SNAPSHOT</version>

<properties>
    <spring-version>2.5.6</spring-version>
    <maven-plugin-version>4.1.0.1-fuse</maven-plugin-version>
</properties>

<scm>
    <connection>scm:svn:file:///C:/Users/voncuver/Documents/myRepository/cu</connection>
    <developerConnection>scm:svn:file:///C:/Users/voncuver/Documents/myRepository/cu</developerConnection>
</scm>

<modules>
    <module>cu-pars-engine</module>
    <module>cu-agent</module>
</modules>


<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
                <execution>
                    <configuration>
                        <classifier>${target.env}</classifier>
                    </configuration>
                </execution>
            </executions>
            <configuration>
                <archive>
                    <manifest>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                    </manifest>
                    <manifestEntries>
                        <Build>${JOB_NAME} #${BUILD_NUMBER} at ${BUILD_ID}</Build>
                        <Environment>${environment.type}</Environment>
                        <Revision>${SVN_REVISION}</Revision>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.8</version>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>releases</id>
        <url>
            http://maven.vonc.com/content/repositories/releases/
        </url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>snapshots</id>
        <url>
            http://maven.von.com/content/repositories/snapshots/
        </url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

<dependencyManagement>
    <dependencies>
        <dependency>
            <artifactId>cu-pars-engine</artifactId>
            <groupId>com.voncuver</groupId>
            <version>${pom.version}</version>
        </dependency>
        <dependency>
            <artifactId>cu-agent</artifactId>
            <groupId>com.voncuver</groupId>
            <version>${pom.version}</version>
        </dependency>
</dependencyManagement>

<distributionManagement>
    <repository>
        <id>releases</id>
        <url>http://maven.von.com/content/repositories/releases</url>
        <layout>default</layout>
    </repository>
    <snapshotRepository>
        <id>snapshots</id>
        <url>http://maven.von.com/content/repositories/snapshots</url>
        <layout>default</layout>
        <uniqueVersion>true</uniqueVersion>
    </snapshotRepository>
</distributionManagement>

兒童:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
    <artifactId>cu</artifactId>
    <groupId>com.voncuver</groupId>
    <version>1.6.1-SNAPSHOT</version>
</parent>

<artifactId>cu-pars-engine</artifactId>
<packaging>jar</packaging>


<dependencies>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>javacc-maven-plugin</artifactId>
            <version>2.5</version>
            <executions>
                <execution>
                    <id>javacc</id>
                    <goals>
                        <goal>javacc</goal>
                    </goals>
                </execution>
                <execution>
                    <id>javacc-ptparser</id>
                    <goals>
                        <goal>jjtree-javacc</goal>
                    </goals>
                    <configuration>
                        <isStatic>false</isStatic>
                        <buildNodeFiles>true</buildNodeFiles>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

第二名兒童:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
    <artifactId>cu</artifactId>
    <groupId>com.voncuver</groupId>
    <version>1.6.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>cu-agent</artifactId>
<packaging>jbi-service-unit</packaging>

<dependencies>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.12</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>

如果您具有多模塊構建,則需要在多模塊構建的根目錄而不是在每個子目錄上執行mvn release:prepare和mvn release:perform步驟。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM