DEV Community

Rafael Gimenes Leite
Rafael Gimenes Leite

Posted on

How to use maven to download jars for static project

If you have a old style java project that you just copy the jar files to 'JRE/lib/ext' you can you maven to do this job.

Create a maven app , edit you pom.xml, and put all your dependencies into dependencies block.

<dependencies>
      <dependency>      
        <groupId>org.deeplearning4j</groupId>      
        <artifactId>deeplearning4j-core</artifactId>
        <version>1.0.0-beta5</version>    
      </dependency>         
      <dependency>      
        <groupId>org.deeplearning4j</groupId>      
        <artifactId>deeplearning4j-modelimport</artifactId>      
        <version>1.0.0-beta5</version>    
      </dependency>                       
      <dependency>      
        <groupId>org.nd4j</groupId>      
        <artifactId>nd4j-native-platform</artifactId>
        <version>1.0.0-beta5</version>    
      </dependency>
      <dependency>      
        <groupId>com.google.cloud.dataflow</groupId>      
        <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>  
        <version>2.5.0</version>     
      </dependency>
   </dependencies>
Enter fullscreen mode Exit fullscreen mode

Then ou can create your package, open a terminal navigate to your project and execute the command:

mvn package

After the BUILD you can copy only the jars that the project uses (also all dependencies), using the next command:

mvn dependency:copy-dependencies

Image description

And check the folder "target/dependency" and all jars will be stored into this folder, and you can copy this for your JRE/lib/ext.

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesnโ€™t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.