On Fri, 2003-06-20 at 18:55, Otto von Wachter wrote:I'm a little puzzled by this approach Jason. Here is a much cleaner way IMHO:
Hi all,
I have a question/suggestion on jar dependencies. I think maven is perfect for open source (large/collaborative) projects. I would like to leverage Maven for my internal project at work, but not all dependencies are available on ibiblio (some are not open source, etc.) Also it makes sense for us to keep these jars in CVS, to make sure they don't get lost, and just because "it works".
What I would like is to specify some "private" jar dependencies that are stored in a lib dir. Is there a quick hack that would allow me to do this? If it is, perhaps documenting it would increase the adoption of maven among users like me. If not would it be easy to add this feature? I was thinking of something like this:
<privateDependencies> <libDirectory>lib</libDirectory> </privateDependencies>
or maybe
<build>
<baseClasspath>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</baseClasspath>
...
</build>
I know this might go against the "maven philosophy", but it
would be optional, and it's one of the things that is
keeping me from using Maven instead of Ant.
Something for this will never be built into Maven. You lose anything Maven provides in the way of auto-downloading and verification. I would recommend you save yourself much grief and spend 10 minutes and make yourself a local repository. But do what you like, here's one way you might do it:
<project xmlns:ant="jelly:ant"
xmlns:maven="jelly:maven">
<preGoal name="java:compile"> <ant:path id="my.doublebarrel.classpath"> <fileset dir="${basedir}/lib"> <include name="**/*.jar"/> </fileset> </ant:path>
<maven:addPath id="maven.dependency.classpath"
refid="my.doublebarrel.classpath"/>
</preGoal>
</project>
Again, I do not recommend you do this.
1) Make your own repository structure inside your project under a lib folder 2) Tell maven to use that as an additional remote repository (!)
We're doing this in the http://www.nanocontainer.org/ project. Have a look at:
http://tinyurl.com/ew5l (look at the end of the 1st property)
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/xdoclet/xdoclet2/lib/ (this is our own local repo treated as a remote one)
Of course, if you're in a corporate environment, you should be able to set up a real remote repository on an internal webserver, whihch is an even cleaner solution.
Aslak
Otto
---------------------------------------------------------------------
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]
