Re: Dependencies and the local repository

2004-04-06 Thread Henry Isidro
Jarrell, Maury wrote:

Forgive me for asking what must be a very basic question.  I've searched the
Maven site and scoured the archives for this list and haven't found an
answer.
I have a simple java project defined in an Ant file.  The dependencies for
my current project are in jars in the ${basedir}/lib directory.  I've
configured Ant to include in the classpath whatever jars it finds in that
lib directory.
I'm trying to duplicate this functionality with Maven, and I've hit a
roadblock.  I have jars that don't conform to Maven's idea of a standard
name.  An example would be the mail.jar from Sun's site.  I use it.  I tried
a dependency entry in my project.xml as follows:
dependency
 groupIdmail/groupID
 artifactIdmail/artifactId
 version1.3/version
 jarmail.jar/jar
/dependency
I tried putting the jar in ${HOME}/.maven/repository/jars, but it wasn't
found.  Then I tried to follow the format in the repository and made a
directory structure as follows:
$HOME/.maven/repository/mail/jars/mail.jar

That appears to work, but is that what Maven expects me to do for each jar
file?  This seems like a lot of work for jars that will never be downloaded
from a remote repository anyway.
This all brings me to the fact that I don't grasp the remote repository
concept.  Is there 1 remote repository and it's global to the world?  I went
to http://www.imbiblio.org/maven and looked at the repository there.  It
seems small if it's supposed to be the global parking spot for Maven
projects world-wide.
Please forgive my misunderstanding,
Maury
 

Hi. I don't know if this will help but if you already have a copy of the 
jar dependency that you need, you can override Maven trying to download 
it from the central repository by setting the property 
maven.jar.override to on. Then you can set explicit paths of the 
dependency by setting the property maven.jar.{artifactID} to the path of 
the jar. You can place this in a project.properties file or a 
build.properties file.

Anyway, hope this helps.

Henry S. Isidro

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Dependencies and the local repository

2004-04-06 Thread Jarrell, Maury
Kevin, Henry,

Thanks for your tips.  Maven is cool, I'm just having trouble wrapping my
mind around the repository concept for some reason.

Thanks,
Maury

 -Original Message-
 From: Kevin Hagel [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 06, 2004 4:21 AM
 To: Maven Users List
 Subject: Re: Dependencies and the local repository
 
 if you're using jarmail.jar/jar you can dispense with the
 version1.3/version completely, version/ will in fact be ignored if
 the jar/ tag is used.
 
 the jar tag allows the use of un-versioned packages.  You can use
 ear/, war/ ... I even put my JBoss .SAR file in my local repository,
 stored it in a sars subdirectory.  I was able to specify
 sarmysar.sar/sar and it worked.
 
 Henry Isidro wrote:
 
  Jarrell, Maury wrote:
 
  Forgive me for asking what must be a very basic question.  I've
  searched the
  Maven site and scoured the archives for this list and haven't found an
  answer.
 
  I have a simple java project defined in an Ant file.  The
  dependencies for
  my current project are in jars in the ${basedir}/lib directory.  I've
  configured Ant to include in the classpath whatever jars it finds in
  that
  lib directory.
 
  I'm trying to duplicate this functionality with Maven, and I've hit a
  roadblock.  I have jars that don't conform to Maven's idea of a
 standard
  name.  An example would be the mail.jar from Sun's site.  I use it.
  I tried
  a dependency entry in my project.xml as follows:
 
  dependency
   groupIdmail/groupID
   artifactIdmail/artifactId
   version1.3/version
   jarmail.jar/jar
  /dependency
 
  I tried putting the jar in ${HOME}/.maven/repository/jars, but it
 wasn't
  found.  Then I tried to follow the format in the repository and made a
  directory structure as follows:
 
  $HOME/.maven/repository/mail/jars/mail.jar
 
  That appears to work, but is that what Maven expects me to do for
  each jar
  file?  This seems like a lot of work for jars that will never be
  downloaded
  from a remote repository anyway.
 
  This all brings me to the fact that I don't grasp the remote repository
  concept.  Is there 1 remote repository and it's global to the world?
  I went
  to http://www.imbiblio.org/maven and looked at the repository there.
 It
  seems small if it's supposed to be the global parking spot for Maven
  projects world-wide.
 
  Please forgive my misunderstanding,
  Maury
 
 
 
  Hi. I don't know if this will help but if you already have a copy of
  the jar dependency that you need, you can override Maven trying to
  download it from the central repository by setting the property
  maven.jar.override to on. Then you can set explicit paths of the
  dependency by setting the property maven.jar.{artifactID} to the path
  of the jar. You can place this in a project.properties file or a
  build.properties file.
 
  Anyway, hope this helps.
 
  Henry S. Isidro
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dependencies and the local repository

2004-04-05 Thread Lester Ward
 That appears to work, but is that what Maven expects me to do 
 for each jar file?

The mail.jar (and a few others) are sort of special cases, as I understand
it, because Sun does not license them for redistribution. You have to
download it specifically from Sun and no one else is allowed to post it.
Therefore, the mail jar cannot be made available in the standard Maven
repository. Is this stupid of Sun? Yes. Is this annoying for Maven users?
Yes.

For this and a number of other reasons, our company created our own Maven
repository on our company intranet. This allows us to control the repository
ourselves and, since it is not public, put any jars we like on it (including
commercial stuff). Not least, we can post our own internal jars for use by
other projects within the company.

Basically, this means that every project needs to override maven.repo.remote
in its properties file, but that's pretty much as hard as it gets. The setup
is pretty much just setting up an Apache box somewhere and throwing stuff
into a directory.

(We actually build the repository with a script from our source control
system, but this is probably overkill for most companies.)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dependencies and the local repository

2004-04-05 Thread Jarrell, Maury


 -Original Message-
 From: Lester Ward [mailto:[EMAIL PROTECTED]
 For this and a number of other reasons, our company created our own Maven
 repository on our company intranet. This allows us to control the
 repository
 ourselves and, since it is not public, put any jars we like on it
 (including
 commercial stuff). Not least, we can post our own internal jars for use by
 other projects within the company.

Thanks, Lester.  I've got some learning to do, but this points me in the
right direction.

Maury


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]