views:

69

answers:

2

I do not want to install few jars into repository(local/remote) , i have few jar files located in

c:\work\projects\myapp\src\main\webapp\WEB-INF\lib\test.jar

c:\work\projects\myapp\src\main\webapp\WEB-INF\lib\test2.jar

how to include it into my project when open/edit with netbeans?

+3  A: 

Have you considered adding those two JARs as system dependencies? e.g.,

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>sun.jdk</groupId>
      <artifactId>tools</artifactId>
      <version>1.5.0</version>
      <scope>system</scope>
      <systemPath>${java.home}/../lib/tools.jar</systemPath>
    </dependency>
  </dependencies>
  ...
</project>

Just a word of note, this is NOT recommended and should be used very sparingly, if ever.

The Alchemist
@Pascal Thivent: I up-voted your comment despite your statement that I should get a -10. :) I totally agree with you. I wrote my answer under the assumption that @cometta has his/her reasons for using it. Personally, I hate it when someone goes "but you shouldn't do that!" when I ask a question. I'll update my answer to mention that's it's highly unrecommended.
The Alchemist
@The Alchemist Maybe the last part of my comment was not necessary (note that I actually didn't downvote your answer). At least, it was not a call for punishment but more a scream of frustration :) I will repost a more friendly version.
Pascal Thivent
This is really an **evil** practice strongly [discouraged](http://docs.codehaus.org/display/MAVENUSER/Dependency+Scopes). Every time someone use this, God kills a Maven developer.
Pascal Thivent
+3  A: 

In the past, I've done this by creating a "local" repository directory tree in the project itself, and referring to it in the POM by declaring a local repository with a project relative path.

But that is a hack. (Maybe not so hacky - per @Pascal's comment. I'm still a bit of a Maven novice, despite using it for a year or so.)

Stephen C
That's a muuuuuuuuuuuuuuuuuch better *solution* than the evil system scope **hack**. People keep using the system scope (and recommending it) without understanding how it hurts... This is depressing.
Pascal Thivent