Skip to main content
Expanded. Used a more direct cross reference (as user names can change at any time).
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

A quick&dirtyquick-and-dirty batch solution (based on Alex's answerAlex'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.

A quick&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.

A quick-and-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.

deleted 30 characters in body
Source Link
lmiguelmh
  • 3.3k
  • 1
  • 41
  • 53

So following Alex Lehmann for aA quick&dirty solution, this is a batch file 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.

So following Alex Lehmann for a quick&dirty solution, this is a batch file solution:

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.

A quick&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.

Source Link
lmiguelmh
  • 3.3k
  • 1
  • 41
  • 53

So following Alex Lehmann for a quick&dirty solution, this is a batch file solution:

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.