You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Olivier CHAMPAGNE <ol...@sysde.eads.net> on 2004/01/30 10:18:03 UTC

[2nd edition] MAVEN dependencies' mechanism

If I did not miss-understand the maven dependencies' mechanism in
project.xml :


With
  <dependencies>
    <dependency>
      <id>DEPEND</id>
      <version>1.0</version>
      <url>http://address/plugin/</url>
    </dependency>
  </dependencies>
Maven will first try to download "http://address/plugin/DEPEND/jars/DEPEND
-1.0.jar" under $MAVEN_HOME_LOCAL/repository/DEPEND/jars/DEPEND-1.0.jar
It should be understand as an unspecified/default <type>repository</type>
attribute.

And with
  <dependencies>
    <dependency>
      <id>PLUGIN</id>
      <version>1.0</version>
      <url>http://address/plugin/</url>
      <type>plugin</type>
    </dependency>
  </dependencies>
Maven will first try to download "http://address/plugin/PLUGIN/jars/PLUGIN
-1.0.jar" under $MAVEN_HOME_LOCAL/repository/PLUGIN/jars/PLUGIN-1.0.jar and
expand the jar file under $MAVEN_HOME_LOCAL/plugins/PLUGIN-1.0
(the mechanism is quite different with tags <groupId> and <artifactId>)


In my project, Maven is used as a build framework:
... during the development step (step #1) :
- automate the build process of interdependent tools
- build the end-user framework (viewed as a maven-project template + tools)
- make an intermediate distribution with this end-user framework + external
data

... to modelize, configure and build a final product based on the previous
end-user framework
- ordering the build process steps (step #2)
- * download/ask for intermediate dependencies (bin, data, bin + data) as
needed. Binaries should be not only jars.
- make a distribution with a full-functionnal system (understand:
pre-configured and coherent set of applications ready to be installed on
pre-defined - i.e modelized - hosts).


In this purpose, the maven dependencies' mechanism should be an elegant way
to define a generic download mechanism on demand and to provide a very
light weight intermediate distribution (in step #1) for my "multi-purpose
project".

So my questions are...

1. To be a quite more generic (not only java/binary oriented), is there a
way to define other formats available for automatic download with the
<type> attribute. I mean Is there a way to define dependency as a
DEPEND-1.0.tar or, mostly appreciated, as a PLUGIN-1.0.[tar|bz2|tgz|...].
I tried <type>something</type> which works (download in
$MAVEN_HOME_LOCAL/repository/something/jars/DEPEND-1.0.jar) but I lost the
"precious" automatic expand functionnality of the <type>plugin</type>...

2. Should the dependencies be specific of a particular goal in maven.xml.

With these pre-requisites, it should become coarse to distribute specific
data and made its available (question 1.) on demand (question 2.)

All suggestions are welcome...


    Olivier Champagne @ EADS DCS S.A

     (\(\      "Regular Expression
     ( ~.)     are to strings what
    o((")(")   math is to numbers"



---------------------------------------------------------------------
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: [2nd edition] MAVEN dependencies' mechanism

Posted by Daniel Bonniot <Da...@inria.fr>.
> If I did not miss-understand the maven dependencies' mechanism in
> project.xml :
> 
> 
> With
>   <dependencies>
>     <dependency>
>       <id>DEPEND</id>
>       <version>1.0</version>
>       <url>http://address/plugin/</url>
>     </dependency>
>   </dependencies>
> Maven will first try to download "http://address/plugin/DEPEND/jars/DEPEND
> -1.0.jar" under $MAVEN_HOME_LOCAL/repository/DEPEND/jars/DEPEND-1.0.jar

(I'm new to Maven, so take this with a grain of salt)

I first had the same impression as you, but after investigation it seems that 
the url tag is just used to suggest that URL to the user if the download failed, 
so that the user can download it manually (e.g. if the license does not allow 
the jar to be put in a repository).

If you want a plugin to be downloaded from an alternate repository, what I know 
works is to declare it in a file build.properties in your home directory 
(~/build.properties on Unix, not sure about windows). Example:

   maven.repo.remote=http://nice.sf.net/maven,http://www.ibiblio.org/maven

(ibiblio is the default maven repository)

Daniel



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