You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by tubin gen <fa...@gmail.com> on 2009/05/18 22:56:44 UTC

avoid oracle driver jar

I have maven project , which is jar, war and ear. Ear I deploy in weblogic ,
and to save time I run war with jetty.

because my project uses datasource  , which is provided by weblogic and not
by jetty  and  in order to run   in jetty
I add the deopendency

      <dependency>
          <groupId>commons-dbcp</groupId>
          <artifactId>commons-dbcp</artifactId>
          <version>1.2.2</version>
          <scope>compile</scope>
      </dependency>

      <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc</artifactId>
          <version>14</version>
          <scope>compile</scope>
      </dependency>

and also created new file jetty-env.xml .

now I want to tell maven to exclude the above three  whenever ear is build ,
becasue its for weblogic and i donto the them , please tell me how i can
tell maven to avaoi above files and dependency ?

Re: avoid oracle driver jar

Posted by Fabien KRUBA <fa...@gmail.com>.
You can may be try to define 2 profiles for your project:one for weblogic
without the jdbc driver and one for jetty with that dependency...

your profile can be activated by -P option on maven command line



On Mon, May 18, 2009 at 4:56 PM, tubin gen <fa...@gmail.com> wrote:

> I have maven project , which is jar, war and ear. Ear I deploy in weblogic
> ,
> and to save time I run war with jetty.
>
> because my project uses datasource  , which is provided by weblogic and not
> by jetty  and  in order to run   in jetty
> I add the deopendency
>
>      <dependency>
>          <groupId>commons-dbcp</groupId>
>          <artifactId>commons-dbcp</artifactId>
>          <version>1.2.2</version>
>          <scope>compile</scope>
>      </dependency>
>
>      <dependency>
>          <groupId>com.oracle</groupId>
>          <artifactId>ojdbc</artifactId>
>          <version>14</version>
>          <scope>compile</scope>
>      </dependency>
>
> and also created new file jetty-env.xml .
>
> now I want to tell maven to exclude the above three  whenever ear is build
> ,
> becasue its for weblogic and i donto the them , please tell me how i can
> tell maven to avaoi above files and dependency ?
>

RE: avoid oracle driver jar

Posted by Martin Gainty <mg...@hotmail.com>.
something like...

<assembly>
  <!-- TODO: a jarjar format would be better -->
  <id>ear</id>
  <formats>
    <format>ear</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <fileSets>
    <fileSet>
      <outputDirectory>/</outputDirectory>
    </fileSet>
  </fileSets>
  <dependencySets>
    <dependencySet>
      <outputDirectory>/</outputDirectory>
      <unpack>true</unpack>
      <scope>runtime</scope>
      <excludes>
        <exclude>commons-dbcp:commons-dbcp</exclude>
        <exclude>com.oracle:ojdbc</exclude>
      </excludes>
     </dependencySet>
   </dependencySets>
....
</assembly>

Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Mon, 18 May 2009 16:56:44 -0400
> Subject: avoid oracle driver jar
> From: fachhoch@gmail.com
> To: users@maven.apache.org
> 
> I have maven project , which is jar, war and ear. Ear I deploy in weblogic ,
> and to save time I run war with jetty.
> 
> because my project uses datasource  , which is provided by weblogic and not
> by jetty  and  in order to run   in jetty
> I add the deopendency
> 
>       <dependency>
>           <groupId>commons-dbcp</groupId>
>           <artifactId>commons-dbcp</artifactId>
>           <version>1.2.2</version>
>           <scope>compile</scope>
>       </dependency>
> 
>       <dependency>
>           <groupId>com.oracle</groupId>
>           <artifactId>ojdbc</artifactId>
>           <version>14</version>
>           <scope>compile</scope>
>       </dependency>
> 
> and also created new file jetty-env.xml .
> 
> now I want to tell maven to exclude the above three  whenever ear is build ,
> becasue its for weblogic and i donto the them , please tell me how i can
> tell maven to avaoi above files and dependency ?

_________________________________________________________________
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009