0

Is there any method, which allows me to download the maven dependencies using a pom.xml, without having maven installed?

Note the use of another computer is not possible, nor is using another build tool, or installing one.

I would appreciate answers not breaking these constraints, as that already has answers: Using Maven to download dependencies to a directory on the command line.

Community
  • 1
  • 1
Derrops
  • 7,651
  • 5
  • 30
  • 60
  • 2
    Well, I guess those restrictions are there for a reason. Can't you have your Softworkers do that stuff for you? If you need that for your work, then there has got to be a way to come to the results without you being fired. – Fildor Sep 07 '15 at 13:13
  • I'm sure they have their reasons. Doesn't help my situation. I don't have any Softworkers ) : – Derrops Sep 07 '15 at 13:21
  • I was talking about the Software-Dept. If this "I want to run a few maven projects off github " isn't personal fun but serious work to get your actual job done, then I am sure you will be given the possibility to come to the results of that research. Either by giving you the needed rights and software or by delegating it to a person that has the rights and software. If your boss will decline any stuff from github anyway, then running some project off it doesn't make sense. – Fildor Sep 07 '15 at 13:26
  • I'm just an intern, I can't get the rights, I only want a template, not going to use the code. – Derrops Sep 08 '15 at 07:48
  • 1
    Then the only answer must be: This is impossible without breaking at least one of your constraints. – Fildor Sep 08 '15 at 11:20
  • @Fildor I would rather have that as an answer than an answer which is not valid. – Derrops Sep 08 '15 at 11:42

1 Answers1

1

I'm not aware of such a tool.

You can use the maven-dependency-plugin and inject the following snippet in your pom.xml:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.10</version>
    <executions>
      <execution>
        <id>copy-dependencies</id>
        <phase>process-resources</phase>
        <goals>
          <goal>copy-dependencies</goal>
        </goals>
        <configuration>
          <outputDirectory>${project.build.directory}/target/libs</outputDirectory>
          <overWriteReleases>false</overWriteReleases>
          <overWriteSnapshots>false</overWriteSnapshots>
          <overWriteIfNewer>true</overWriteIfNewer>
        </configuration>
      </execution>
    </executions>
  </plugin>

Then, take this pom and run maven:

mvn clean process-resources

Run it outside your problematic network.
All dependencies will be resolved and copied to ${project.build.directory}/target/libs

I hope this helps.

Eldad Assis
  • 10,464
  • 11
  • 52
  • 78