Note that there are some explanatory texts on larger screens.

plurals
  1. POCopy maven dependencies within Java code
    primarykey
    data
    text
    <p>There are very few documentations and examples on this (those exists are useless).</p> <p>I would like to copy all the dependencies of a given pom.xml file. Usually, I can use <code>mvn dependency:copy-dependencies</code> on command line or use <code>maven-dependecy-plugin</code> configuration in the pom file.</p> <p>However, I would like to do it programmatically on a given pom.xml file. So far, I figured that I will need to use <code>MavenCli</code></p> <pre><code>MavenCli cli = new MavenCli(); cli.doMain(new String[]{"clean", "dependency:copy-dependencies", "-DincludeScope=runtime"}, "C:\\workspace\\gui", null, null); </code></pre> <p>where <code>"C:\\workspace\\gui"</code> is a directory containing a pom.xml</p> <p>but the above code gives me the following error:</p> <pre><code> [ERROR] Failed to execute goal on project test-pom: Could not resolve dependencies for project gigadot:test-pom:jar:0.5-SNAPSHOT: Failed to collect dependencies for [commons-lang:commons-lang:jar:2.6 (compile), commons-io:commons-io:jar:2.0.1 (compile), org.apache.commons:commons-exec:jar:1.1 (compile), org.apache.commons:commons-math:jar:2.2 (compile), xom:xom:jar:1.2.5 (compile), log4j:log4j:jar:1.2.16 (provided)]: Failed to read artifact descriptor for org.apache.commons:commons-math:jar:2.2: Could not transfer artifact org.apache.commons:commons-math:pom:2.2 from/to central (http://repo1.maven.org/maven2): No connector available to access repository central (http://repo1.maven.org/maven2) of type default using the available factories -&gt; [Help 1] </code></pre> <p>Does anyone know how to solve this problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload