Add jars to maven 2 build class path without installing them?

0 votes
Aug 29, 2018 in Java by parth295
• 4,640 points
41 views

1 answer to this question.

0 votes

wn votequick&dirty batch solution (based on Alex's answer):

libs.bat

@ECHO OFF
FOR %%I IN (*.jar) DO (
echo ^<dependency^>
echo ^<groupId^>local.dummy^</groupId^>
echo ^<artifactId^>%%I^</artifactId^>
echo ^<version^>0.0.1^</version^>
echo ^<scope^>system^</scope^>
echo ^<systemPath^>${project.basedir}/lib/%%I^</systemPath^>
echo ^</dependency^>
)

Execute it like this: libs.bat > libs.txt. Then open libs.txt and copy its content as dependencies.

In my case, I only needed the libraries to compile my code, and this solution was the best for that purpose.

answered Aug 29, 2018 by samarth295
• 2,190 points

Related Questions In Java

0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

answered Nov 5, 2018 in Java by Sushmita
• 6,880 points
341 views
0 votes
10 answers

What is the correct way to add external Jars to IntelliJ IDEA Project?

The best way is to add the ...READ MORE

answered Dec 10, 2018 in Java by Nabarupa
26,112 views
0 votes
1 answer

How can we add local .jar file dependency to build.gradle file?

You can refer the below code if ...READ MORE

answered Jun 27, 2018 in Java by Akrati
• 960 points
1,628 views
0 votes
1 answer

How to build jars from IntelliJ properly?

How to build a jar with IntelliJ ...READ MORE

answered Oct 12, 2018 in Java by sharth
• 3,350 points
554 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
242 views
0 votes
1 answer
0 votes
3 answers

How to read input from Console using Scanner Class?

A simple example: import java.util.Scanner; public class Expl { ...READ MORE

answered Jul 31, 2018 in Java by samarth295
• 2,190 points
439 views
+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,190 points
684 views