You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Guillaume Lederrey <gu...@gmail.com> on 2007/12/18 12:20:55 UTC

Dependency rpoblem in multi-module project

Hello !

When trying to build my multi-module project, I get a "missing
dependency" from one module to the other. To be clearer :

I have multiple modules, declared in the main pom.xml as :
<modules>
    <module>M2_Artifacts/shared</module>
    <module>M2_Artifacts/server</module>
    <module>M2_Artifacts/client</module>
    <module>M2_Artifacts/util</module>
    <module>M2_Artifacts/batch</module>
    <module>M2_Artifacts/test</module>
</modules>

"shared" doesnt depend on any other module, but "server" depends on
"shared". I thought that maven would be able to build the modules in
the order specified. If i build manually each module in that order, it
works, but when trying to do a "mvn install" from the main directory,
the build fails with a dependency error (see bleow).

Any idea ?

Thanks !



[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) libAfc.EvenementMetierPoc:EvenementMetierPoc_shared:jar:0.1.0

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=libAfc.EvenementMetierPoc -DartifactId=
EvenementMetierPoc_shared \
          -Dversion=0.1.0 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=libAfc.EvenementMetierPoc -DartifactId=Even
ementMetierPoc_shared \
          -Dversion=0.1.0 -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) libAfc.EvenementMetierPoc:EvenementMetierPoc_server:jar:0.1.0
        2) libAfc.EvenementMetierPoc:EvenementMetierPoc_shared:jar:0.1.0

-- 
Jabber : gehel@amessage.ch
Skype : Guillaume.Lederrey
Projects :
* http://rwanda.wordpress.com/
* http://rwandatech.wordpress.com/

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


Re: Dependency rpoblem in multi-module project

Posted by Guillaume Lederrey <gu...@gmail.com>.
I did change the names of the modules to match the directories. But
I'm pretty sure it's not a typo.

If I build the modules one after the other, it works fine :

mvn -f EvenementMetier_shared/pom.xml install
mvn -f EvenementMetier_server/pom.xml install
...


On 19/12/2007, Heinrich Nirschl <he...@gmail.com> wrote:
> On Dec 19, 2007 9:21 AM, Guillaume Lederrey
> <gu...@gmail.com> wrote:
> > Problem still not solved. I tried a couple of things :
>
> Seems to be a typo somewhere. You said the module is called
> EvenementMetier_shared but maven is looking for
> EvenementMetierPoc_shared (note the "Poc"). Double check the group and
> artifact ids and the packaging of the modules.
>
> - Henry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Jabber : gehel@amessage.ch
Skype : Guillaume.Lederrey
Projects :
* http://rwanda.wordpress.com/
* http://rwandatech.wordpress.com/

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


Re: Dependency rpoblem in multi-module project

Posted by Heinrich Nirschl <he...@gmail.com>.
On Dec 19, 2007 9:21 AM, Guillaume Lederrey
<gu...@gmail.com> wrote:
> Problem still not solved. I tried a couple of things :

Seems to be a typo somewhere. You said the module is called
EvenementMetier_shared but maven is looking for
EvenementMetierPoc_shared (note the "Poc"). Double check the group and
artifact ids and the packaging of the modules.

- Henry

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


Re: Dependency rpoblem in multi-module project

Posted by Guillaume Lederrey <gu...@gmail.com>.
Problem still not solved. I tried a couple of things :

* change the project structure to follow the structure I am used to :
only put modules one level deep and not 2, have the same name for the
artifactId and the directory of the module. The module declaration in
the main pom is now :
<modules>
    <module>EvenementMetier_shared</module>
    <module>EvenementMetier_server</module>
    <module>EvenementMetier_client</module>
    <module>EvenementMetier_util</module>
    <module>EvenementMetier_batch</module>
</modules>

* I double check for circular dependencies
* None of the version number for the modules are defined, they are
inherited from the parent pom

When I try to build the project with "mvn install", I still get the
same error. It fails on "EvenementMetier_server" saying that it cant
find the "EvenementMetier_shared" dependency. I checked my local
repository, and at that point I have only
"maven-metadata-<repository-id>.xml" files. No jar. I have one of
those file for each repository defined in my settings.xml.

I'm still completely lost ... Where should I be looking ?


The settings.xml is as follow :

		<profile>
			<id>ctiRepositories-devAccess</id>			
			<activation>
				<activeByDefault>true</activeByDefault>
				<property>
					<name>ctiRepositories</name>
					<value>devAccess</value>
				</property>				
			</activation>

			<properties>
				<maven2Repository_projet>
					file://X:/commun/Melusine/maven2repository
				</maven2Repository_projet>
				<maven2Repository_lot>
					file://X:/commun/Melusine/maven2repository
				</maven2Repository_lot>
				<siteRepository>
					file://X:/commun/Melusine/projects_Website
				</siteRepository>
			</properties>

			<repositories>

				<repository>
					<id>internal.repo1</id>
					<name>internal.repo1</name>
					<url>file://X:/commun/Melusine/maven2repository/repo1</url>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
					<releases>
						<enabled>true</enabled>
					</releases>
				</repository>

				<repository>
					<id>internal.project.release</id>
					<name>internal.project.release</name>
					<url>file://X:/commun/Melusine/maven2repository/project_release</url>
					<snapshots>
						<enabled>false</enabled>
					</snapshots>
					<releases>
						<enabled>true</enabled>
					</releases>
				</repository>

				<repository>
					<id>internal.project.snapshot</id>
					<name>internal.project.snapshot</name>
					<url>file://X:/commun/Melusine/maven2repository/project_snapshot</url>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
					<releases>
						<enabled>false</enabled>
					</releases>
				</repository>

				<repository>
					<id>internal.lot.release</id>
					<name>internal.lot.release</name>
					<url>file://X:/commun/Melusine/maven2repository/lot_release</url>
					<snapshots>
						<enabled>false</enabled>
					</snapshots>
					<releases>
						<enabled>true</enabled>
					</releases>
				</repository>

				<repository>
					<id>internal.lot.snapshot</id>
					<name>internal.lot.snapshot</name>
					<url>file://X:/commun/Melusine/maven2repository/lot_snapshot</url>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
					<releases>
						<enabled>false</enabled>
					</releases>
				</repository>
			</repositories>
			<pluginRepositories>
				<pluginRepository>
					<id>SHARED_DEVCTI_PLUGINS_M2_REPO</id>
					<name>
						Repository commun des plugins MAVEN2 utiliss au DEV CTI
					</name>
					<url>file://X:/commun/Melusine/maven2repository/repo1</url>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
					<releases>
						<enabled>true</enabled>
					</releases>
				</pluginRepository>
				<pluginRepository>
					<id>internal.plugin.release</id>
					<name>internal.project.release</name>
					<url>file://X:/commun/Melusine/maven2repository/project_release</url>
					<snapshots>
						<enabled>false</enabled>
					</snapshots>
					<releases>
						<enabled>true</enabled>
					</releases>
				</pluginRepository>
				<pluginRepository>
					<id>internal.plugin.snapshot</id>
					<name>internal.project.snapshot</name>
					<url>file://X:/commun/Melusine/maven2repository/project_snapshot</url>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
					<releases>
						<enabled>false</enabled>
					</releases>
				</pluginRepository>
			</pluginRepositories>
		</profile>




On 18/12/2007, Guillaume Lederrey <gu...@gmail.com> wrote:
> Hello !
>
> When trying to build my multi-module project, I get a "missing
> dependency" from one module to the other. To be clearer :
>
> I have multiple modules, declared in the main pom.xml as :
> <modules>
>     <module>M2_Artifacts/shared</module>
>     <module>M2_Artifacts/server</module>
>     <module>M2_Artifacts/client</module>
>     <module>M2_Artifacts/util</module>
>     <module>M2_Artifacts/batch</module>
>     <module>M2_Artifacts/test</module>
> </modules>
>
> "shared" doesnt depend on any other module, but "server" depends on
> "shared". I thought that maven would be able to build the modules in
> the order specified. If i build manually each module in that order, it
> works, but when trying to do a "mvn install" from the main directory,
> the build fails with a dependency error (see bleow).
>
> Any idea ?
>
> Thanks !
>
>
>
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> Missing:
> ----------
> 1) libAfc.EvenementMetierPoc:EvenementMetierPoc_shared:jar:0.1.0
>
>   Try downloading the file manually from the project website.
>
>   Then, install it using the command:
>       mvn install:install-file -DgroupId=libAfc.EvenementMetierPoc -DartifactId=
> EvenementMetierPoc_shared \
>           -Dversion=0.1.0 -Dpackaging=jar -Dfile=/path/to/file
> Alternatively, if you host your own repository you can deploy the file there:
>     mvn deploy:deploy-file -DgroupId=libAfc.EvenementMetierPoc -DartifactId=Even
> ementMetierPoc_shared \
>           -Dversion=0.1.0 -Dpackaging=jar -Dfile=/path/to/file \
>            -Durl=[url] -DrepositoryId=[id]
>
>   Path to dependency:
>         1) libAfc.EvenementMetierPoc:EvenementMetierPoc_server:jar:0.1.0
>         2) libAfc.EvenementMetierPoc:EvenementMetierPoc_shared:jar:0.1.0
>
> --
> Jabber : gehel@amessage.ch
> Skype : Guillaume.Lederrey
> Projects :
> * http://rwanda.wordpress.com/
> * http://rwandatech.wordpress.com/
>


-- 
Jabber : gehel@amessage.ch
Skype : Guillaume.Lederrey
Projects :
* http://rwanda.wordpress.com/
* http://rwandatech.wordpress.com/

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