2012-06-08 3 views
3

Я хочу выпустить проект со следующим structre (упрощенный):Maven релиз не работает с группировкой ПОМ

родительском
--module A (тип упаковки: ПОМ)

--module B (тип банка)

--module C (тип банка, использует A и B в зависимости)

Я хочу выпустить свой проект с помощью Дженкинс. Конструкция отлично работает. Но для выпуска кажется, что в реакторе не будет версии сложного проекта. Сбой сборки невозможен, поскольку в моем хранилище maven не существует версии проекта типа pom. С зависимостью типа jar все работает хорошо.

Может кто-нибудь мне помочь?

здесь вы можете увидеть консоль из вне и мой тест ПОМ-файлы:

[INFO] [release:prepare {execution: default-cli}] 
[INFO] Verifying that there are no local modifications... 
[INFO] Executing: /bin/sh -c cd /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace && git status 
[INFO] Working directory: /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace 
[INFO] Checking dependencies and plugins for snapshots ... 
[INFO] Transforming 'Unnamed - com.basfits.test:parentTest:pom:0.0.2-SNAPSHOT'... 
[INFO] Transforming 'Unnamed - com.basfits.test:childTestSimplePom:pom:0.0.2-SNAPSHOT'... 
[INFO] Transforming 'Unnamed - com.basfits.test:testjarDep:jar:0.0.2-SNAPSHOT'... 
[INFO] Transforming 'Unnamed - com.basfits.test:testPomDep:jar:0.0.2-SNAPSHOT'... 
[INFO] Updating testjarDep to 0.0.2 
[INFO] Updating childTestSimplePom to 0.0.2 
[INFO] Not generating release POMs 
[INFO] Executing goals 'clean verify'... 
[INFO] [INFO] Scanning for projects... 
[INFO] [INFO] Reactor build order: 
[INFO] [INFO] Unnamed - com.basfits.test:parentTest:pom:0.0.2 
[INFO] [INFO] Unnamed - com.basfits.test:childTestSimplePom:pom:0.0.2 
[INFO] [INFO] Unnamed - com.basfits.test:testjarDep:jar:0.0.2 
[INFO] [INFO] Unnamed - com.basfits.test:testPomDep:jar:0.0.2 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] Building Unnamed - com.basfits.test:parentTest:pom:0.0.2 
[INFO] [INFO] task-segment: [clean, verify] 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] [clean:clean {execution: default-clean}] 
[INFO] [INFO] [site:attach-descriptor {execution: default-attach-descriptor}] 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] Building Unnamed - com.basfits.test:childTestSimplePom:pom:0.0.2 
[INFO] [INFO] task-segment: [clean, verify] 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] [clean:clean {execution: default-clean}] 
[INFO] [INFO] [site:attach-descriptor {execution: default-attach-descriptor}] 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] Building Unnamed - com.basfits.test:testjarDep:jar:0.0.2 
[INFO] [INFO] task-segment: [clean, verify] 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] [clean:clean {execution: default-clean}] 
[INFO] [INFO] [resources:resources {execution: default-resources}] 
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] [INFO] skip non existing resourceDirectory /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testjarDep/src/main/resources 
[INFO] [INFO] [compiler:compile {execution: default-compile}] 
[INFO] [INFO] Compiling 1 source file to /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testjarDep/target/classes 
[INFO] [INFO] [resources:testResources {execution: default-testResources}] 
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] [INFO] skip non existing resourceDirectory /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testjarDep/src/test/resources 
[INFO] [INFO] [compiler:testCompile {execution: default-testCompile}] 
[INFO] [INFO] No sources to compile 
[INFO] [INFO] [surefire:test {execution: default-test}] 
[INFO] [INFO] No tests to run. 
[INFO] [INFO] [jar:jar {execution: default-jar}] 
[INFO] [INFO] Building jar: /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testjarDep/target/testjarDep-0.0.2.jar 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] Building Unnamed - com.basfits.test:testPomDep:jar:0.0.2 
[INFO] [INFO] task-segment: [clean, verify] 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] [clean:clean {execution: default-clean}] 
[INFO] [INFO] Deleting directory /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testPomDep/target 
[INFO] [INFO] [resources:resources {execution: default-resources}] 
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] [INFO] skip non existing resourceDirectory /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/testPomDep/src/main/resources 
[INFO] Downloading: http://maven.bcs.de/content/repositories/bis-releases/com/basfits/test/childTestSimplePom/0.0.2/childTestSimplePom-0.0.2.pom 
[INFO] [INFO] Unable to find resource 'com.basfits.test:childTestSimplePom:pom:0.0.2' in repository bis-releases (http://maven.bcs.de/content/repositories/bis-releases) 
[INFO] Downloading: http://maven.bcs.de/content/groups/public/com/basfits/test/childTestSimplePom/0.0.2/childTestSimplePom-0.0.2.pom 
[INFO] [INFO] Unable to find resource 'com.basfits.test:childTestSimplePom:pom:0.0.2' in repository central (http://repo1.maven.org/maven2) 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [ERROR] BUILD ERROR 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] Failed to resolve artifact. 
[INFO] 
[INFO] Missing: 
[INFO] ---------- 
[INFO] 1) com.basfits.test:childTestSimplePom:pom:0.0.2 
[INFO] Path to dependency: 
[INFO]  1) com.basfits.test:testPomDep:jar:0.0.2 
[INFO]  2) com.basfits.test:childTestSimplePom:pom:0.0.2 
[INFO] 
[INFO] ---------- 
[INFO] 1 required artifact is missing. 
[INFO] 
[INFO] for artifact: 
[INFO] com.basfits.test:testPomDep:jar:0.0.2 
[INFO] 
[INFO] from the specified remote repositories: 
[INFO] nexus-central (http://maven.bcs.de/content/groups/public), 
[INFO] bis-releases (http://maven.bcs.de/content/repositories/bis-releases), 
[INFO] bis-snapshots (http://maven.bcs.de/content/repositories/bis-snapshots) 
[INFO] 
[INFO] 
[INFO] 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] For more information, run Maven with the -e switch 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] Total time: 3 seconds 
[INFO] [INFO] Finished at: Fri Jun 08 13:43:48 CEST 2012 
[INFO] [INFO] Final Memory: 21M/271M 
[INFO] [INFO] ------------------------------------------------------------------------ 
[JENKINS] Archiving /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/workspace/pom.xml to /CVS1/home/jenkins/.jenkins/jobs/PomDepstest/modules/com.basfits.test$parentTest/builds/2012-06-08_13-43-09/archive/com.basfits.test/parentTest/0.0.2-SNAPSHOT/parentTest-0.0.2-SNAPSHOT.pom 
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD ERROR 
<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/xsd/maven-4.0.0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>com.basfits.test</groupId> 
<artifactId>parentTest</artifactId> 
<version>0.0.2-SNAPSHOT</version> 
<packaging>pom</packaging> 
<build /> 
<scm> 
    <connection>...</connection> 
    <url>...</url> 
    </scm> 
<distributionManagement> 
    <repository> 
     <id>bis-releases</id> 
     <name>BIS Releases</name> 
     <url>...</url> 
    </repository> 
    <snapshotRepository> 
     <id>bis-snapshots</id> 
     <name>BIS Snapshots</name> 
     <url>...</url> 
    </snapshotRepository> 
</distributionManagement> 
<modules> 
    <module>childTestSimplePom</module> 
    <module>testPomDep</module> 
    <module>testjarDep</module> 
</modules> 

<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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <artifactId>parentTest</artifactId> 
     <groupId>com.basfits.test</groupId> 
     <version>0.0.2-SNAPSHOT</version> 
     <relativePath>..</relativePath> 
    </parent> 
    <artifactId>childTestSimplePom</artifactId> 
    <packaging>pom</packaging> 
    <build /> 


    <dependencies> 
     <dependency> 
      <groupId>com.mysema.querydsl</groupId> 
      <artifactId>querydsl-apt</artifactId> 
      <version>2.3.0</version> 
     </dependency> 
    </dependencies> 
</project> 
<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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
    <artifactId>parentTest</artifactId> 
    <groupId>com.basfits.test</groupId> 
    <version>0.0.2-SNAPSHOT</version> 
    <relativePath>..</relativePath> 
    </parent> 
    <artifactId>testPomDep</artifactId> 
    <build /> 

    <dependencies> 
    <dependency> 
     <artifactId>testjarDep</artifactId> 
     <version>0.0.2-SNAPSHOT</version>  
     <groupId>com.basfits.test</groupId>  
    </dependency> 
    <dependency> 
     <artifactId>childTestSimplePom</artifactId> 
     <version>0.0.2-SNAPSHOT</version>  
     <groupId>com.basfits.test</groupId>  
     <type>pom</type> 
     <scope>compile</scope> 
    </dependency> 



    </dependencies> 

</project> 
+0

вы должны отметить ответ @Wim Deblauwe как принятый, поэтому он получает свой реплик. – liltitus27

ответ

11

Вы можете установить цели подготовки к clean install (по умолчанию clean verify). Добавьте это в группировке П:

<build> 
    <plugins> 
     <plugin> 
      <artifactId>maven-release-plugin</artifactId> 
      <configuration> 
       <autoVersionSubmodules>true</autoVersionSubmodules> 
       <preparationGoals>clean install</preparationGoals> 
      </configuration> 
     </plugin> 
    <plugins> 
<build> 

Это позволит установить выпущенное pom.xml в локальное хранилище, так что ваши Подмодули могут найти его.

+0

Спасибо! Это прекрасно работает! – Barbara

Смежные вопросы