I do not want to install a few jars into a Maven repository (both local/remote). In particular I have a 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 them into my project when open/edit with NetBeans?
Look in your . m2 directory (use the paths which you see in the dialog above) and check whether the files are there or whether they are really missing. If they are missing, run "mvn install" (see the "Run as..." menu) to download them.
Creating a local repository holding jars not available in a public repository
NOTE: I use Eclipse, so some of the instructions are specific to Eclipse. Most are easily generalizable.
The jar was created by Maven in another project with the following...
<groupId>com.foo</groupId> <artifactId>test</artifactId> <version>0.1.1</version> <packaging>jar</packaging>
Define the local repository
<repositories> <repository> <id>data-local</id> <name>data</name> <url>file://${project.basedir}/repo</url> </repository> </repositories>
Add the dependency on the local jar. From our example above, this would be...
<dependency> <groupId>com.foo</groupId> <artifactId>test</artifactId> <version>0.1.1</version> </dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With