configure the maven-jar-plugin to have additional directory be added to the classpath. check out "addClasspath" and "classpathprefix" in the jar doc
On Jan 29, 2008 10:41 PM, crishantha <[EMAIL PROTECTED]> wrote: > > Hi Oliver, > > I have the same issue as donald mentioned. Hence, I tried the shade plugin > by adding the code snippet you gave to the POM. But I still get an error > saying that, > > \target\HPMASReports-1.0-SNAPSHOT-shaded.pom (The system cannot find the > path specified) > > Am I missing anything in the process? > > Please help > > Thank you very much > > Crishantha > > Olivier Lamy wrote: > > > > Hi, > > You can build a jar which include the dependencies. > > Add this in your pom : > > > > <plugin> > > <artifactId>maven-shade-plugin</artifactId> > > <executions> > > <execution> > > <phase>package</phase> > > <goals> > > <goal>shade</goal> > > </goals> > > </execution> > > </executions> > > </plugin> > > > > -- > > Olivier > > > > 2008/1/25, dornad <[EMAIL PROTECTED]>: > >> > >> Hello everybody, > >> > >> I've been trying to look for this all over the forums but so far, I > >> haven't > >> been able to find any answer. > >> > >> I have a m2 project in Eclipse, which uses some external libraries via > >> Maven's Dependency Mechanism. As long as I run my project inside > >> Eclipse, > >> everything's perfect. The problem is when I build my JAR via mvn > >> package. > >> > >> When I try to run the JAR, I get a NoClassDefFoundError: > >> org/apache/commons/logging/LogFactory. > >> > >> Is there anyway to tell maven to set the classpath, so the JAR can find > >> the > >> missing dependencies in the local repository ? > >> > >> I also plan to distribute this app to some pcs, and some of them > doesn't > >> have maven installed. I read somewhere that including those JAR inside > >> my > >> JAR is a bad practice. Any ideas ? > >> > >> I'm uploading my http://www.nabble.com/file/p15095045/pom.xml pom.xml, > >> so > >> everyone can check it. > >> -- > >> View this message in context: > >> > http://www.nabble.com/mvn-package%3A-Generated-JAR-and-external-dependencies-tp15095045s177p15095045.html > >> Sent from the Maven - Users mailing list archive at > >> Nabble.com<http://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/mvn-package%3A-Generated-JAR-and-external-dependencies-tp15095045s177p15176393.html > Sent from the Maven - Users mailing list archive at > Nabble.com<http://nabble.com/> > . > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
