Some time ago (a few months), a user contributed a shell script (bash iirc) which cycled through a "lib" directory, installed each jar into the user's local m2 repo with generated poms, and output a long list of dependencies that could be copied and pasted into your project's pom.xml file to include all jars in your project.
If you search the mailing list archive, I'm sure you'll find it. However, this is **really** the wrong approach IMO. You will be much better off in the long-term by finding the proper groupId and artifactId for your jars (assuming they are already in public Maven repos) and adding them to your project, and then handling non-public JARs by installing/deploying them individually to your local (or better, corporate shared) Maven repo. Wayne On 10/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
There's the "teach a man to fish" response and the "give a man a fish" response. I'll try to do a bit of both. I think the deeper question is what are your goals in migrating the project to maven? Most users find the dependency management features of Maven to be one of its strongest points. If you're dependant on mostly popular open source projects, you won't have to create and upload the files to a repository. For more information see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html I'm not aware of any single setting to do what you want, but from the link above, there is a 'system' scope you can specify for the dependencies. It shouldn't be hard to write a quick-n-dirty script to loop over the contents of your lib directory and spit out the appropriate xml that you could paste into your pom. It's a one time only effort. From this point, I'd encourage you to search for your dependencies in the master maven repository and modify the scope away from 'system', but this could be done incrementally. Here's a handy search page to do so http://www.mvnregistry.com/ Greg Vaughn [EMAIL PROTECTED] "goatwuss" <[EMAIL PROTECTED]> 10/24/2006 02:14 PM Please respond to "Maven Users List" <[email protected]> To [email protected] cc Subject RE: Maven Noobie - How can I just add a directory of jars to my classpat Hello, Thanks for the reply... the situation is that I am trying to load a project with 100 or so jar files that I need to include in the library... I don't want to have to manually add each one to a repository, and include a separate <dependency> for each jar... I just need a quick and dirty way to compile this project THX adampp wrote: > > I'm new too, so just been through this, but no you don't. You create a > pom.xml file, or have maven do it for you by using "mvn archetype:create > <args>..". Then you add <dependency> xml frags that tell what libs your > project depends on. Then when you do a "mvn compile" or related goal, > maven > will download all the deps for you. So an example dependency is > > <dependency> > <groupId>junit</groupId> > <artifactId>junit</artifactId> > <version>3.8.1</version> > </dependency> > > The big idea of maven is it gets rid of that ./lib directory. > > You can track down your dependencies at a www.ibiblio.org/maven2 and use > google to help you out by googling for site:www.ibiblio.org maven2 junit. > It will lead you to a directory with a junit-3.8.1.pom file that will tell > you the info needed to craft your dependency rule. > > Hope this helps. > Adam > > -----Original Message----- > From: goatwuss [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 24, 2006 11:54 AM > To: [email protected] > Subject: Maven Noobie - How can I just add a directory of jars to my > classpath? > > > Hello - I am getting started with Maven. I am looking at online guides > and > literature, and I'm trying to not be retarded > > All I want to do is somehow point to a directory of jar files (./lib) and > add these to the classpath so I can compile my code in maven. > > I can see that there's this idea of the "repository" in maven... Do I > have > to manually add each required jar file to the local repository? Do I need > to put more lines in my pom.xml for each required jar, or can I just say > "include this whole directory of jars" > > Thanks, and sorry if this is a dumb question > -- > View this message in context: > http://www.nabble.com/Maven-Noobie---How-can-I-just-add-a-directory-of-jars- > to-my-classpath--tf2503345.html#a6979200 > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > 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] > > > -- View this message in context: http://www.nabble.com/Maven-Noobie---How-can-I-just-add-a-directory-of-jars-to-my-classpath--tf2503345.html#a6979513 Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ====================================================================== Confidentiality Notice: The information contained in and transmitted with this communication is strictly confidential, is intended only for the use of the intended recipient, and is the property of Countrywide Financial Corporation or its affiliates and subsidiaries. If you are not the intended recipient, you are hereby notified that any use of the information contained in or transmitted with the communication or dissemination, distribution, or copying of this communication is strictly prohibited by law. If you have received this communication in error, please immediately return this communication to the sender and delete the original message and any copy of it in your possession. ======================================================================
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
