You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by alexsil <al...@zucchetti.it> on 2006/11/03 17:23:41 UTC

Versioning problems

I' ve a project so structured.

---aaa.progettoPilota-------------|--------- progettoCommons
                      |           |______ pom.xml               
	              |
                      |--------  progettoBusiness
                      |           |______ pom.xml
                      |
                      |--------- progettoSistema
                      |           |______ pom.xml
                      |
                      |--------- progettoWeb
                      |           |______ pom.xml
                      |
                      |_________ pom.xml


Top level pom has versioned in this way:


  ...
  <modelVersion>4.0.0</modelVersion> 
  <groupId>aaa.progettoPilota</groupId> 
  <artifactId>progettoPilota</artifactId> 
  <packaging>pom</packaging> 
  <version>2.0-SNAPSHOT</version> 
  ...


All child projects inherit the version in this way:

   ...
  <parent>
   <artifactId>progettoPilota</artifactId> 
   <groupId>aaa.progettoPilota</groupId> 
   <version>2.0-SNAPSHOT</version> 
  </parent>
   ...

I've a local central snapshot repository. Maven try to download new
snapshots versions each 60 seconds.


The dependencies are: 
             progettoWeb         depend from   progettoSistema
             progettoSistema     depend from   progettoBusiness
             progettoBusiness    depend from   progettoCommons    

I'm using dependency management, such as

 <dependencyManagement>
 <dependencies>
  <dependency>
   <groupId>aaa.progettoPilota</groupId> 
   <artifactId>commons</artifactId> 
   <version>${project.version}</version> 
  </dependency>
 <dependency>
   <groupId>aaa.progettoPilota</groupId> 
   <artifactId>business</artifactId> 
   <version>${project.version}</version> 
   </dependency>
 <dependency>
   <groupId>aaa.progettoPilota</groupId> 
   <artifactId>sistema</artifactId> 
   <version>${project.version}</version> 
   </dependency>
 <dependency>
   <groupId>aaa.progettoPilota.web</groupId> 
   <artifactId>progettoWeb</artifactId> 
   <version>${project.version}</version> 
 </dependency>
 ...
     


Now, let go to the problem.

1) Deploy all the projects on the repository (clear at the beginning) using
"mvn deploy" command at the top pom.xml level. 
   All projects in the repository have the same format, for example:  
"business-2.0-20061103.154755-1.jar". In particular 
   build number is 1 for all.
2) Let go into progettoWeb directory and try to compile with "mvn clean
compile" command. Maven checks for dependency, 
   eventually update and it's all right.

3) Let go into progettoSistema and deploy only this project (mvn deploy). In
the snapshot repository I'll have: sistema-2.0-20061103.155109-2.jar (buil
number 2)

4) Let go into progettoWeb and compile (mvn clean compile). It's all rights.

5) Now, try to use maven from another machine or clean your "local
repository" (%user_HOME%\m2\repository...). 
Go into progettoWeb and try to compile (mvn clean compile). 
Maven SHOULD BE downloads all snapshots from local central repository and
compile progettoWeb. 
Instead I get an error such as:


***************************************************************************************************************************
W:\workspace\Maven\progettoWeb>mvn clean compile
[INFO] Scanning for projects...
[INFO]
----------------------------------------------------------------------------
[INFO] Building progettoPilotaWeb
[INFO]    task-segment: [clean, compile]
[INFO]
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory W:\workspace\Maven\progettoWeb\target
[INFO] Deleting directory W:\workspace\Maven\progettoWeb\target\classes
[INFO] Deleting directory W:\workspace\Maven\progettoWeb\target\test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] snapshot aaa.progettoPilota:sistema:2.0-SNAPSHOT: checking for
updates from repository-inhouse_snapshot
Downloading:
http://propus:8081/maven-proxy-webapp/repository/aaa/progettoPilota/sistema/2.0-SNAPSHOT/sistema-2.0-20061103.155109-2.pom
657b downloaded
[INFO] snapshot aaa.progettoPilota:progettoPilota:2.0-SNAPSHOT: checking for
updates from repository-inhouse_snapshot
Downloading:
http://propus:8081/maven-proxy-webapp/repository/aaa/progettoPilota/progettoPilota/2.0-SNAPSHOT/progettoPilota-2.0-20061103.154755-1.pom
7K downloaded
Downloading:
http://propus:8081/maven-proxy-webapp/repository/aaa/progettoPilota/business/2.0-SNAPSHOT/business-2.0-20061103.155109-2.pom
[WARNING] Unable to get resource from repository repository-inhouse_snapshot
(http://propus:8081/maven-proxy-webapp/repository)
Downloading:
http://propus:8081/maven-proxy-webapp/repository/aaa/progettoPilota/sistema/2.0-SNAPSHOT/sistema-2.0-20061103.155109-2.jar
2K downloaded
Downloading:
http://propus:8081/maven-proxy-webapp/repository/aaa/progettoPilota/business/2.0-SNAPSHOT/business-2.0-20061103.155109-2.jar
[WARNING] Unable to get resource from repository repository-inhouse_snapshot
(http://propus:8081/maven-proxy-webapp/repository)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) aaa.progettoPilota:business:jar:2.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=aaa.progettoPilota
-DartifactId=business \
          -Dversion=2.0-20061103.155109-2 -Dpackaging=jar
-Dfile=/path/to/file

  Path to dependency:
        1) aaa.progettoPilota.web:progettoPilotaWeb:war:2.0-SNAPSHOT
        2) aaa.progettoPilota:sistema:jar:2.0-SNAPSHOT
        3) aaa.progettoPilota:business:jar:2.0-20061103.155109-2

----------
1 required artifact is missing.

for artifact:
  aaa.progettoPilota.web:progettoPilotaWeb:war:2.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  repository-inhouse_snapshot
(http://propus:8081/maven-proxy-webapp/repository)


[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Fri Nov 03 16:58:26 GMT+01:00 2006
[INFO] Final Memory: 3M/7M
[INFO]
------------------------------------------------------------------------

*******************************************************************************************************************************

The problem is that maven try to dowload the snapshot "business" with build
number 2, but build number 2 is to "Sistema", not business. Also the
"qualifier"
20061103.155109 is not of "business" but of "sistema" (business is
business-2.0-20061103.154755-1.jar). It looks like that maven make a mix
between name and version of 
"business" and "sistema".

Is this a BUG ??? 
I'm making a mistake in the versions managements of projects ?

Thank you in advance.
Alex.
 
-- 
View this message in context: http://www.nabble.com/Versioning-problems-tf2568885s177.html#a7160676
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org