You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stijn de Witt <St...@bergland-it.nl> on 2004/08/03 12:09:56 UTC

List all dependencies or only main ones?

Hi,

A quick question. Assume a project A, which depends on projects B and C. If
project D depends on A, does it also have to state it's (implicit)
dependencies on B and C in project.xml?

TIA,
-Stijn



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


RE: List all dependencies or only main ones?

Posted by Carlos Sanchez <ap...@carlos.cousas.net>.
Hi,

That's wrong, as Maven 1.0 you need to list all dependencies.

Regards

Carlos Sanchez
A Coruña, Spain

Oness Project
http://oness.sourceforge.net
 

> -----Original Message-----
> From: Reddy MVS [mailto:sreddy@orangescape.com] 
> Sent: Tuesday, August 03, 2004 1:13 PM
> To: 'Maven Users List'
> Subject: RE: List all dependencies or only main ones?
> 
> Hi Stijn,
> 
>            You don't require B and C for D. If D is Depends 
> on A dependencies. It will require if run alone A. you don't 
> have call them B and C in D dependencies.
> 
> Thanks
> 
> Reddy MVS
> 
>  
> 
> --------------------------------------------------------------
> --------------
> -----
> 
> -----Original Message-----
> From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl] 
> Sent: Tuesday, August 03, 2004 4:27 PM
> To: Maven Users List
> Subject: Re: List all dependencies or only main ones?
> 
>  
> 
> Hi Reddy,
> 
>  
> 
> Let me show it with an example
> 
>  
> 
> Project a is a maven project, using two jars, B-1.0.jar and C-1.0.jar.
> 
> Projects B and C are plain jars
> 
> Project D is a maven project, using 1 jar, A.1.0.jar.
> 
>  
> 
> A: project.xml
> 
> ..
> 
> <dependencies>
> 
>   <dependency>
> 
>    <groupId>B</groupdId>
> 
>    <artifactId>B</artifactId>
> 
>    <version>1.0</version>
> 
>    <properties />
> 
>   </dependency>
> 
>  
> 
>   <dependency>
> 
>    <groupId>C</groupdId>
> 
>    <artifactId>C</artifactId>
> 
>    <version>1.0</version>
> 
>    <properties />
> 
>   </dependency>
> 
> </dependencies>
> 
> ..
> 
>  
> 
> D: project.xml
> 
> ..
> 
> <dependencies>
> 
>   <dependency>
> 
>    <groupId>A</groupdId>
> 
>    <artifactId>A</artifactId>
> 
>    <version>1.0</version>
> 
>    <properties />
> 
>   </dependency>
> 
> </dependencies>
> 
> ..
> 
>  
> 
> The final program (D) will need all 4 jars to run, but does 
> that mean that I
> 
> have to add the dependencies from project A to D, or will 
> maven be able to
> 
> determine from project A's pom that it has to include B-1.0.jar and
> 
> C-1.0.jar to?
> 
>  
> 
> "...why don't you try using remote repository call them in project A
> 
> (project.xml) instead of calling in each and every project."
> 
>  
> 
> This sounds like an interesting possibility, could you 
> explain some further?
> 
>  
> 
> Thanks,
> 
> -Stijn
> 
>  
> 
>  
> 
> ----- Original Message ----- 
> 
> From: "Reddy MVS" <sr...@orangescape.com>
> 
> To: "'Maven Users List'" <us...@maven.apache.org>
> 
> Sent: Tuesday, August 03, 2004 12:37 PM
> 
> Subject: RE: List all dependencies or only main ones?
> 
>  
> 
>  
> 
> >    Hi Stijn,
> 
> > 
> 
> > 
> 
> > 
> 
> >   I am not sure. Let me do some research let you know the 
> status, why
> 
> don't
> 
> > you try using remote repository call them in project A (project.xml)
> 
> instead
> 
> > of calling in each and every project. The compilation needs all the
> 
> > dependencies in local repository. I think it doesn't worry about 
> > weather
> 
> you
> 
> > call all the dependencies in Project A or Project B if it's 
> depending 
> > on
> 
> > other project. If you run alone you need to call dependencies for
> 
> respective
> 
> > Library files (.jar). Also what do you mean by main ones?
> 
> > 
> 
> > Thanks
> 
> > 
> 
> > Reddy MVS
> 
> > 
> 
> > 
> 
> > 
> 
> > -----Original Message-----
> 
> > From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl]
> 
> > Sent: Tuesday, August 03, 2004 3:40 PM
> 
> > To: Maven Users List
> 
> > Subject: List all dependencies or only main ones?
> 
> > 
> 
> > 
> 
> > 
> 
> > Hi,
> 
> > 
> 
> > 
> 
> > 
> 
> > A quick question. Assume a project A, which depends on 
> projects B and C.
> 
> If
> 
> > 
> 
> > project D depends on A, does it also have to state it's (implicit)
> 
> > 
> 
> > dependencies on B and C in project.xml?
> 
> > 
> 
> > 
> 
> > 
> 
> > TIA,
> 
> > 
> 
> > -Stijn
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> ---------------------------------------------------------------------
> 
> > 
> 
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> 
> > 
> 
> > For additional commands, e-mail: users-help@maven.apache.org
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
>  
> 
>  
> 
> ---------------------------------------------------------------------
> 
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> 
> For additional commands, e-mail: users-help@maven.apache.org
> 
>  
> 
>  
> 
> 



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


RE: List all dependencies or only main ones?

Posted by Reddy MVS <sr...@orangescape.com>.
Hi Stijn,

           You don't require B and C for D. If D is Depends on A
dependencies. It will require if run alone A. you don't have call them B and
C in D dependencies.

Thanks

Reddy MVS

 

----------------------------------------------------------------------------
-----

-----Original Message-----
From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl] Sent: Tuesday,
August 03, 2004 4:27 PM
To: Maven Users List
Subject: Re: List all dependencies or only main ones?

 

Hi Reddy,

 

Let me show it with an example

 

Project a is a maven project, using two jars, B-1.0.jar and C-1.0.jar.

Projects B and C are plain jars

Project D is a maven project, using 1 jar, A.1.0.jar.

 

A: project.xml

..

<dependencies>

  <dependency>

   <groupId>B</groupdId>

   <artifactId>B</artifactId>

   <version>1.0</version>

   <properties />

  </dependency>

 

  <dependency>

   <groupId>C</groupdId>

   <artifactId>C</artifactId>

   <version>1.0</version>

   <properties />

  </dependency>

</dependencies>

..

 

D: project.xml

..

<dependencies>

  <dependency>

   <groupId>A</groupdId>

   <artifactId>A</artifactId>

   <version>1.0</version>

   <properties />

  </dependency>

</dependencies>

..

 

The final program (D) will need all 4 jars to run, but does that mean that I

have to add the dependencies from project A to D, or will maven be able to

determine from project A's pom that it has to include B-1.0.jar and

C-1.0.jar to?

 

"...why don't you try using remote repository call them in project A

(project.xml) instead of calling in each and every project."

 

This sounds like an interesting possibility, could you explain some further?

 

Thanks,

-Stijn

 

 

----- Original Message ----- 

From: "Reddy MVS" <sr...@orangescape.com>

To: "'Maven Users List'" <us...@maven.apache.org>

Sent: Tuesday, August 03, 2004 12:37 PM

Subject: RE: List all dependencies or only main ones?

 

 

>    Hi Stijn,

> 

> 

> 

>   I am not sure. Let me do some research let you know the status, why

don't

> you try using remote repository call them in project A (project.xml)

instead

> of calling in each and every project. The compilation needs all the

> dependencies in local repository. I think it doesn't worry about weather

you

> call all the dependencies in Project A or Project B if it's depending on

> other project. If you run alone you need to call dependencies for

respective

> Library files (.jar). Also what do you mean by main ones?

> 

> Thanks

> 

> Reddy MVS

> 

> 

> 

> -----Original Message-----

> From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl]

> Sent: Tuesday, August 03, 2004 3:40 PM

> To: Maven Users List

> Subject: List all dependencies or only main ones?

> 

> 

> 

> Hi,

> 

> 

> 

> A quick question. Assume a project A, which depends on projects B and C.

If

> 

> project D depends on A, does it also have to state it's (implicit)

> 

> dependencies on B and C in project.xml?

> 

> 

> 

> TIA,

> 

> -Stijn

> 

> 

> 

> 

> 

> 

> 

> ---------------------------------------------------------------------

> 

> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org

> 

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

> 

> 

> 

> 

> 

> 

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@maven.apache.org

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

 

 


RE: List all dependencies or only main ones?

Posted by Charles Daniels <cj...@yahoo.com>.
Stijn,

You must explicitly include B and C dependencies in project D's project.xml.
As mentioned earlier in this thread, Maven 2 will support what is called
"transitive dependencies", meaning that in the future, you will not have to
explicitly specify these implicit dependencies.  However, for now, you must
explicitly specify them.

-- Chuck

> -----Original Message-----
> From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl]
> Sent: Tuesday, August 03, 2004 11:57 AM
> To: Maven Users List
> Subject: Re: List all dependencies or only main ones?
>
>
> Hi Reddy,
>
> Let me show it with an example
>
> Project a is a maven project, using two jars, B-1.0.jar and C-1.0.jar.
> Projects B and C are plain jars
> Project D is a maven project, using 1 jar, A.1.0.jar.
>
> A: project.xml
> ..
> <dependencies>
>   <dependency>
>    <groupId>B</groupdId>
>    <artifactId>B</artifactId>
>    <version>1.0</version>
>    <properties />
>   </dependency>
>
>   <dependency>
>    <groupId>C</groupdId>
>    <artifactId>C</artifactId>
>    <version>1.0</version>
>    <properties />
>   </dependency>
> </dependencies>
> ..
>
> D: project.xml
> ..
> <dependencies>
>   <dependency>
>    <groupId>A</groupdId>
>    <artifactId>A</artifactId>
>    <version>1.0</version>
>    <properties />
>   </dependency>
> </dependencies>
> ..
>
> The final program (D) will need all 4 jars to run, but does that
> mean that I
> have to add the dependencies from project A to D, or will maven be able to
> determine from project A's pom that it has to include B-1.0.jar and
> C-1.0.jar to?
>
> "...why don't you try using remote repository call them in project A
> (project.xml) instead of calling in each and every project."
>
> This sounds like an interesting possibility, could you explain
> some further?
>
> Thanks,
> -Stijn
>
>
> ----- Original Message -----
> From: "Reddy MVS" <sr...@orangescape.com>
> To: "'Maven Users List'" <us...@maven.apache.org>
> Sent: Tuesday, August 03, 2004 12:37 PM
> Subject: RE: List all dependencies or only main ones?
>
>
> >    Hi Stijn,
> >
> >
> >
> >   I am not sure. Let me do some research let you know the status, why
> don't
> > you try using remote repository call them in project A (project.xml)
> instead
> > of calling in each and every project. The compilation needs all the
> > dependencies in local repository. I think it doesn't worry about weather
> you
> > call all the dependencies in Project A or Project B if it's depending on
> > other project. If you run alone you need to call dependencies for
> respective
> > Library files (.jar). Also what do you mean by main ones?
> >
> > Thanks
> >
> > Reddy MVS
> >
> >
> >
> > -----Original Message-----
> > From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl]
> > Sent: Tuesday, August 03, 2004 3:40 PM
> > To: Maven Users List
> > Subject: List all dependencies or only main ones?
> >
> >
> >
> > Hi,
> >
> >
> >
> > A quick question. Assume a project A, which depends on projects B and C.
> If
> >
> > project D depends on A, does it also have to state it's (implicit)
> >
> > dependencies on B and C in project.xml?
> >
> >
> >
> > TIA,
> >
> > -Stijn
> >
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> >
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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


Re: List all dependencies or only main ones?

Posted by Stijn de Witt <St...@bergland-it.nl>.
Hi Reddy,

Let me show it with an example

Project a is a maven project, using two jars, B-1.0.jar and C-1.0.jar.
Projects B and C are plain jars
Project D is a maven project, using 1 jar, A.1.0.jar.

A: project.xml
..
<dependencies>
  <dependency>
   <groupId>B</groupdId>
   <artifactId>B</artifactId>
   <version>1.0</version>
   <properties />
  </dependency>

  <dependency>
   <groupId>C</groupdId>
   <artifactId>C</artifactId>
   <version>1.0</version>
   <properties />
  </dependency>
</dependencies>
..

D: project.xml
..
<dependencies>
  <dependency>
   <groupId>A</groupdId>
   <artifactId>A</artifactId>
   <version>1.0</version>
   <properties />
  </dependency>
</dependencies>
..

The final program (D) will need all 4 jars to run, but does that mean that I
have to add the dependencies from project A to D, or will maven be able to
determine from project A's pom that it has to include B-1.0.jar and
C-1.0.jar to?

"...why don't you try using remote repository call them in project A
(project.xml) instead of calling in each and every project."

This sounds like an interesting possibility, could you explain some further?

Thanks,
-Stijn


----- Original Message ----- 
From: "Reddy MVS" <sr...@orangescape.com>
To: "'Maven Users List'" <us...@maven.apache.org>
Sent: Tuesday, August 03, 2004 12:37 PM
Subject: RE: List all dependencies or only main ones?


>    Hi Stijn,
>
>
>
>   I am not sure. Let me do some research let you know the status, why
don't
> you try using remote repository call them in project A (project.xml)
instead
> of calling in each and every project. The compilation needs all the
> dependencies in local repository. I think it doesn't worry about weather
you
> call all the dependencies in Project A or Project B if it's depending on
> other project. If you run alone you need to call dependencies for
respective
> Library files (.jar). Also what do you mean by main ones?
>
> Thanks
>
> Reddy MVS
>
>
>
> -----Original Message-----
> From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl]
> Sent: Tuesday, August 03, 2004 3:40 PM
> To: Maven Users List
> Subject: List all dependencies or only main ones?
>
>
>
> Hi,
>
>
>
> A quick question. Assume a project A, which depends on projects B and C.
If
>
> project D depends on A, does it also have to state it's (implicit)
>
> dependencies on B and C in project.xml?
>
>
>
> TIA,
>
> -Stijn
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
>
>


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


RE: List all dependencies or only main ones?

Posted by Reddy MVS <sr...@orangescape.com>.
   Hi Stijn,

 

  I am not sure. Let me do some research let you know the status, why don't
you try using remote repository call them in project A (project.xml) instead
of calling in each and every project. The compilation needs all the
dependencies in local repository. I think it doesn't worry about weather you
call all the dependencies in Project A or Project B if it's depending on
other project. If you run alone you need to call dependencies for respective
Library files (.jar). Also what do you mean by main ones?

Thanks 

Reddy MVS 

 

-----Original Message-----
From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl] 
Sent: Tuesday, August 03, 2004 3:40 PM
To: Maven Users List
Subject: List all dependencies or only main ones?

 

Hi,

 

A quick question. Assume a project A, which depends on projects B and C. If

project D depends on A, does it also have to state it's (implicit)

dependencies on B and C in project.xml?

 

TIA,

-Stijn

 

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@maven.apache.org

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

 

 


Dependencies inheritnace between projects with the same groupId

Posted by Marcin Werla <mw...@tlen.pl>.
Hi,

I've written a little piece of jelly code. Maybe someone else will also find
it useful. I have this in maven.xml in parent project for all my projects.
With this code I have very simple dependency inheritance between my
subprojects. Of course it can be easily expanded to artifacts from multiple
groups.

-- Marcin Werla

----------------------------------------------------------------------------

    <preGoal name="build:start">
      <echo message="Gathering dependencies from associated ${pom.GroupId}
subprojects..."/>
      <j:new var="extraDepsSet" className="java.util.HashSet"/>
      <j:set var="artifacts" value="${pom.Artifacts}"/>
      <j:forEach var="artifact" items="${artifacts}">
        <j:set var="dependency" value="${artifact.Dependency}"/>       
        <j:if test="${dependency.GroupId == pom.GroupId}">
          <echo message="Checking project
${dependency.GroupId}:${dependency.ArtifactId}"/>
          <util:file
name="${maven.repo.local}/${dependency.GroupId}/poms/${dependency.ArtifactId
}-${dependency.Version}.pom" var="pomFile" />
          <j:invokeStatic var="depProject"
className="org.apache.maven.MavenUtils" method="getProject">
            <j:arg type="java.io.File" value="${pomFile}" />
            <j:arg type="org.apache.maven.jelly.MavenJellyContext"
value="${context}"/>
            <j:arg type="boolean" value="false"/>
          </j:invokeStatic> 
          <j:forEach var="extDependency" items="${depProject.Dependencies}">
            <j:if test="${extDependency.GroupId != pom.GroupId &amp;&amp;
!extDependency.GroupId.equals('junit') &amp;&amp;
pom.getDependency(extDependency.Id) == null}">
              <j:forEach var="depProperty" items="${dependency.Properties}">
                <j:if
test="${!depProperty.equals('property:eclipse.dependency:true')}">
                  <j:expr
value="${extDependency.addProperty(depProperty)}"/>
                </j:if>
              </j:forEach>
              <j:set var="" value="${extraDepsSet.add(extDependency)}"/>
            </j:if>
          </j:forEach>
        </j:if>
      </j:forEach>
      <j:forEach var="extDep" items="${extraDepsSet}">
        <echo message="Adding: ${extDep.Id} ${extDep.Properties}"/>
        <j:expr value="${pom.addDependency(extDep)}"/>
        <j:new var="extArt"
className="org.apache.maven.repository.GenericArtifact">
          <j:arg value="${extDep}"/>
        </j:new>
        <j:set var="depPath"
value="${maven.repo.local}${extArt.generatePath()}"/>
        <j:expr value="${extArt.setPath(depPath)}"/>
        <j:set var="" value="${artifacts.add(extArt)}"/>
      </j:forEach>      
    </preGoal>

RE: List all dependencies or only main ones?

Posted by John Casey <jd...@commonjava.org>.
>    Answer is no. You don't have worry about B and C because once you have
> Project A depends on B & C. Once A got compiled it has all the compilation
> files (B & C) inside Project A jar. For project D you don't require Project
> B and C. 
> 

just to address this advice directly: if project A's api exposes ANY of the 
classes from projects B or C, you would have to declare them in any case or 
else deal with the ClassNotFoundException. The relevance of this issue is of 
course superceded by the fact that maven-1 doesn't support transitive dependencies, 
but it's important to understand.

cheers,

john


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


RE: List all dependencies or only main ones?

Posted by Reddy MVS <sr...@orangescape.com>.
Hi 

   Answer is no. You don't have worry about B and C because once you have
Project A depends on B & C. Once A got compiled it has all the compilation
files (B & C) inside Project A jar. For project D you don't require Project
B and C. 

 

Thanks & Regards

Reddy MVS

 

 

 

-----Original Message-----
From: Stijn de Witt [mailto:Stijn.deWitt@bergland-it.nl] 
Sent: Tuesday, August 03, 2004 3:40 PM
To: Maven Users List
Subject: List all dependencies or only main ones?

 

Hi,

 

A quick question. Assume a project A, which depends on projects B and C. If

project D depends on A, does it also have to state it's (implicit)

dependencies on B and C in project.xml?

 

TIA,

-Stijn

 

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@maven.apache.org

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