Thank you! Worked perfectly =)

-Mark
At 12:18 PM 10/17/2003 +0300, you wrote:
Here is the fragment that lies at the root of one maven.xml and gets loaded
always when loading maven.xml. In other projects I did similar things, but
e.g. in a preGoal for "test:test". Please note that commonly those jars are
not compile-time dependencies but rather runtime dependencies for proper
testing. The scheme can also be extended for compile-time dependencies, but
in that case it's a little dirty and using POM dependencies would have been
a better choice.

   <!-- check if properties local.oracle.driver and
      local.mysql.driver are available as loaded from *.properties
      They point to the JDBC runtime-required jars on local machine -->
   <fail message="Oracle driver not found. Check build.properties!"
unless="local.oracle.driver" />
   <fail message="MySQL driver not found. Check build.properties!"
unless="local.mysql.driver" />

   <!-- we have to add LOCAL Oracle and MySQL driver jars
      They are defined normally through build.properties
      by local.oracle.driver and local.mysql.driver -->
   <path id="local.local.oracle.driver.classpath">
      <pathelement path="${local.oracle.driver}" />
   </path>
   <maven:addPath id="maven.dependency.classpath"
     refid="local.local.oracle.driver.classpath"/>
   <path id="local.local.mysql.driver.classpath">
      <pathelement path="${local.mysql.driver}" />
   </path>
   <maven:addPath id="maven.dependency.classpath"
      refid="local.local.mysql.driver.classpath"/>

   <!-- We have to add also local-installed JBoss server classes -->
   <path id="local.local.jboss.server.classpath">
      <fileset dir="${local.jboss.home}/server/default/lib/"
includes="**/*.jar" />
      <!-- and their Ant JMX for management -->
      <pathelement path="${local.jboss.home}/client/jbossjmx-ant.jar" />
   </path>
   <maven:addPath id="maven.dependency.classpath"
     refid="local.local.jboss.server.classpath"/>

As you can see, we allow each developer to use its own version of JDBC
drivers, placed wherever on its system, as long as they declare the proper
things in build.properties. This allows some freedom relative to the version
of jars used, as they are a local system resource and may have some
externally-enforced version relationship with other system binaries (e.g.
OCI-based Oracle JDBC driver has to be version-correlated with the native
OCI Oracle libs).
At the same time, when testing on several versions of JBoss, this trick
allows to push the decision "which JBoss am I going to run on" at developer
level and at runtime-level, rather than relying (and enforcing) on POM and
uploading JBoss jars in the repository.

Florin

----- Original Message -----
From: "Mark McBride" <[EMAIL PROTECTED]>
To: "Maven Developers List" <[EMAIL PROTECTED]>
Sent: Thursday, October 16, 2003 5:48 PM
Subject: Re: Add additional jars to maven.dependency.classpath?


> Can you elaborate on what you did in the pregoal (sorry if I'm missing the > obvious =))? Were you able to add to the maven.dependency.classpath? > > Thanks! > > -Mark > At 10:52 AM 10/16/2003 +0300, you wrote: > >I had a similar situation, where some jars were needed (including JDBC > >drivers) and those jars were slightly different on different developer > >machines, therefore specifying them through POM was not an option. I took > >the maven.xml pregoal approach and everything is fine for several months > >now. I cannot gurarantee it's "legal" from Maven's point of view, but it > >works for us. > > > >----- Original Message ----- > >From: "Mark McBride" <[EMAIL PROTECTED]> > >To: "Maven Developers List" <[EMAIL PROTECTED]> > >Sent: Tuesday, October 14, 2003 7:29 PM > >Subject: Re: Add additional jars to maven.dependency.classpath? > > > > > > > This is true, there's actually only a handful of jars that are actually > > > compiled against. The only concern I have with only entering those handful > > > of jars as dependencies is that somehow a developer could change the > > > version of the jdbc driver not knowing that it has really already been > > > dictated by oc4j's manifest.mf. I'll admit that this is being a little > > > picky, but I would like to get our configuration exactly the same as our > > > target deployment environment. This will be easier when we can group > > > dependencies together so that there's more meaning. But for now I'm > >reading > > > that I should probably just enter those dependencies in the project.xml. > > > > > > Thank you! > > > > > > -Mark > > > > > > > > > At 09:09 AM 10/14/2003 +1000, you wrote: > > > >Surely you don't depend on all 20 jars? > > > >-- > > > >dIon Gillard, Multitask Consulting > > > >Blog: http://blogs.codehaus.org/people/dion/ > > > > > > > > > > > >Mark McBride <[EMAIL PROTECTED]> wrote on 14/10/2003 04:23:28 AM: > > > > > > > > > Can I add additional jars to the maven.dependency.classpath property > > > >that > > > > > have not been defined as a dependency? I have a project which is using > > > > > OC4J/Orion and the main jar for this server has a manifest which lists > > > >out > > > > > 20+ jars for it's classpath. Instead of declaring all 20+ jars in my > > > > > project.xml I'd like to add to the classpath (in the pregoal for > > > > > java:compile) the jars listed in the manifest.mf. > > > > > > > > > > Thanks in advance! > > > > > > > > > > -Mark > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > 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] > > > > > > Mark T. McBride > > > Computer Scientist > > > Lawrence Livermore National Laboratory > > > http://www.llnl.gov > > > > > > Office: (925) 423-1627 > > > Fax: (925) 423-3140 > > > > > > > > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > Mark T. McBride > Computer Scientist > Lawrence Livermore National Laboratory > http://www.llnl.gov > > Office: (925) 423-1627 > Fax: (925) 423-3140 >



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

Mark T. McBride Computer Scientist Lawrence Livermore National Laboratory http://www.llnl.gov

Office: (925) 423-1627
Fax: (925) 423-3140

Reply via email to