You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Raivo Rebane <ra...@r-systems.ee> on 2020/10/30 16:39:38 UTC

mvn exec:java don't use jars from project repo

.Hello

I run following command :

mvn exec:java -Dexec.mainClass="SolrJExample" 
-Dexec.classpathScope=runtime  -X

and

classpath conains following line :

     <classpathentry kind="var" path="repo/lib/solrj/1.0/solrj-1.0.jar"/>

end pom conains following lines :

     <dependencies>
         <dependency>
           <groupId>lib</groupId>
           <artifactId>solrj</artifactId>
           <version>1.0</version>
         </dependency>
     </dependencies>

And it compiles perfectly.

But command mvn exec:java

gives me :

java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient
     at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build 
(HttpSolrClient.java:968)
     at SolrJExample.getSolrClient (SolrJExample.java:189)
     at SolrJExample.<clinit> (SolrJExample.java:33)

but it declares following :

[DEBUG] Project Dependencies will be included.
[DEBUG] Collected project artifacts [lib:solrj:jar:1.0:compile]
[DEBUG] Collected project classpath 
[/home/hydra/workspace1/p0/target/classes]
[DEBUG] Adding to classpath : /home/hydra/workspace1/p0/target/classes
[DEBUG] Adding project dependency artifact: solrj to classpath

What is wrong ?

Regards

Raivo





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: mvn exec:java don't use jars from project repo

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Looks like your Solr.Pom does not define a dependency on httpclient. You can either change that or add it as a runtime dependency to your local Pom.

Gruss
Bernd


--
http://bernd.eckenfels.net
________________________________
Von: Raivo Rebane <ra...@r-systems.ee>
Gesendet: Friday, October 30, 2020 5:39:38 PM
An: users@maven.apache.org <us...@maven.apache.org>
Betreff: mvn exec:java don't use jars from project repo

.Hello

I run following command :

mvn exec:java -Dexec.mainClass="SolrJExample"
-Dexec.classpathScope=runtime  -X

and

classpath conains following line :

     <classpathentry kind="var" path="repo/lib/solrj/1.0/solrj-1.0.jar"/>

end pom conains following lines :

     <dependencies>
         <dependency>
           <groupId>lib</groupId>
           <artifactId>solrj</artifactId>
           <version>1.0</version>
         </dependency>
     </dependencies>

And it compiles perfectly.

But command mvn exec:java

gives me :

java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient
     at org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build
(HttpSolrClient.java:968)
     at SolrJExample.getSolrClient (SolrJExample.java:189)
     at SolrJExample.<clinit> (SolrJExample.java:33)

but it declares following :

[DEBUG] Project Dependencies will be included.
[DEBUG] Collected project artifacts [lib:solrj:jar:1.0:compile]
[DEBUG] Collected project classpath
[/home/hydra/workspace1/p0/target/classes]
[DEBUG] Adding to classpath : /home/hydra/workspace1/p0/target/classes
[DEBUG] Adding project dependency artifact: solrj to classpath

What is wrong ?

Regards

Raivo





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org