2012-06-08 9 views
3

Je veux sortir un projet avec le structre suivant (simplifié):version Maven ne fonctionne pas avec un groupement pom

parent
--module A (type d'emballage: pom)

--module B (pot de type)

--module C (pot de type A et B utilise comme dépendance)

Je veux libérer mon projet avec l'aide de Jenkins. Une construction fonctionne bien. Mais pour la version, il semble qu'il n'y aura pas de version du projet Pom-typed dans le réacteur. La construction a échoué car aucune version du projet de type pom ne peut être trouvée dans mon référentiel maven. Avec la dépendance de type jar tout fonctionne bien.

Quelqu'un peut-il m'aider?

ici vous pouvez voir la console sortir dehors et mes fichiers pom-test:

[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

Vous devez marquer la réponse de @Wim Deblauwe comme étant la réponse acceptée afin d'obtenir son crédit de repères. – liltitus27

Répondre

11

Vous pouvez définir les objectifs de préparation à clean install (valeur par défaut est clean verify). Ajouter dans votre groupant pom:

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

Cela installera le pom.xml publié dans votre dépôt local afin que vos sous-modules peuvent trouver.

+0

Merci! Cela fonctionne bien! – Barbara

Questions connexes