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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Raivo Rebane
.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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bernd Eckenfels
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 <[hidden email]>
Gesendet: Friday, October 30, 2020 5:39:38 PM
An: [hidden email] <[hidden email]>
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: [hidden email]
For additional commands, e-mail: [hidden email]