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

2020-10-30 Thread 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 
Gesendet: Friday, October 30, 2020 5:39:38 PM
An: users@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 :

 

end pom conains following lines :

 
 
   lib
   solrj
   1.0
 
 

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. (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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



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

2020-10-30 Thread Raivo Rebane

.Hello

I run following command :

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


and

classpath conains following line :

    

end pom conains following lines :

    
        
          lib
          solrj
          1.0
        
    

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. (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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Java11 and javadoc plugin

2020-10-30 Thread Benjamin Marwell
Hi Thomas,

Those test sources are neither in the project we talked about earlier, nor
do they have javadocs.

Let's keep focused on the project you mentioned earlier. Please take a look
at my explanations and the PR they resulted in.

The new project (https://github.com/yagee-de/javadoc-test/
)
does not contain most of the pom.xml changes I suggested, eg setting some
plugin versions.

So, what is unclear in the PR I mentioned in the previous email? I'm happy
to help.

Ben

On Fri, 30 Oct 2020, 15:03 Thomas Scheffler, 
wrote:

> Hi Benajmin,
>
> yes I have test sources present in that directory:
> https://github.com/yagee-de/javadoc-test/tree/master/src/test/java/de/yagee/test
>
> Ironically „mvn javadoc:test-javadoc“ runs without any issues and without
> „test“ or „compile“ running before the „test-javadoc“ goal. No way to get
> it working during „mvn site“ though!
>
> kind regards
>
> Thomas
>
> Am 29.10.2020 um 15:57 schrieb Benjamin Marwell :
>
> Hi Thomas,
>
> | Exit code: 2 - javadoc: error - No source files for package de.yagee.test
>
> You do not have a folder "/project/src/test/java" with any test sources!
>
> I set up an example here:
> https://github.com/FIUS/jvk/pull/123/files
>
> Please be aware that you still cannot create test javadocs nor javadoc
> from dependency sources. As said, please kindly create two issues for
> this.
>
> Am Do., 29. Okt. 2020 um 08:10 Uhr schrieb Thomas Scheffler
> :
>
>
> Hi Benjamin,
>
> you may have done something differently because „mvn test site“ does not
> work here. Could you recheck or give me a hint, what I could have done
> wrong?
>
> kind regards,
>
> Thomas
>
> Am 28.10.2020 um 20:05 schrieb Benjamin Marwell :
>
> Hi Thomas,
>
> no worry, that is as easy to fix as the previous one.
>
> Read carefully:
>
> Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork
>
>
> The javadoc-plugin executes "test-aggregate-no-fork".
>
> Which means: It creates javadoc for your TEST classes from src/test/java.
> That again requires the "test" goal to be run first [1].
>
> Requires dependency resolution of artifacts in scope: test.
>
>
> I rarely found it useful to generate, validate and publish javadoc for
> test classes.
>
> Long story short:
> mvn test site # (test includes compile).
>
> Although imho, you will always want to execute "mvn verify" (or "mvn
> clean verify") anyway, wouldn’t you? ;-)
> This is considered a good habit by Robert Scholte iirc.
>
> If you need more information on the "why", don’t hesitate to ask! :)
>
> [1]
> https://maven.apache.org/plugins/maven-javadoc-plugin/test-aggregate-no-fork-mojo.html
>
> Am Mi., 28. Okt. 2020 um 14:45 Uhr schrieb Thomas Scheffler
> :
>
>
> Hi,
>
> thanks for looking into it. I updated the project a bit so that you can
> easily switch the version with „-Djavadoc.plugin.version=3.0.1“ to see it
> working nice with „mvn site“ and „mvn javadoc:javadoc“. My problem is, that
> I don’t know how to make „site“ run again. „mvn compile site“ will prevent
> the errors for the main javadocs but will fail on test javadocs (Junit
> tests):
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on
> project test: Error generating
> maven-javadoc-plugin:3.2.0:test-aggregate-no-fork report:
> [ERROR] Exit code: 2 - javadoc: error - No source files for package
> de.yagee.test
> [ERROR]
> [ERROR] Command line was: /Users/yagee/Java/Home/14/bin/javadoc @options
> @packages
> [ERROR]
> [ERROR] Refer to the generated Javadoc files in
> '/Users/yagee/git/javadoc-test/target/site/testapidocs' dir.
> [ERROR] -> [Help 1]
>
> I can stick with 3.0.1 for a while, but of cause I want to move forward. I
> set up the minimal project to get this figured out, but I lost.
>
> Looking at
> https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html, there
> is even no hint on suddenly requiring „compile“ starting with version
> 1.1.0. Still the site issue drives me nuts, too.
>
> Thanks again for helping me!
>
> kind regards,
>
> Thomas
>
> Am 27.10.2020 um 19:55 schrieb Benjamin Marwell :
>
> Hi Thomas,
>
> I tested your configuration and found the same issue – however, it may
> not be an issue after all.
>
> You configured your javadoc plugin as part of the reporting section.
> This usually requires the compile goal.
>
> Even if you add the jar goal to the default build->plugin section, it
> will still require compile to be executed. This is expected and
> documented in [2]:
> "Requires dependency resolution of artifacts in scope: compile. &&
> Binds by default to the lifecycle phase: package."
>
> Same description for the javadoc:javadoc goal.
>
> "mvn package site" will work because "package" includes the "compile"
> goal from the default lifecycle.
>
> site (on its own) however is it's own lifecycle and goal and does not
> contain the default's lifecycle compile goal. See [1].
>
> Everything you 

Re: Java11 and javadoc plugin

2020-10-30 Thread Thomas Scheffler
Hi Benajmin,

yes I have test sources present in that directory: 
https://github.com/yagee-de/javadoc-test/tree/master/src/test/java/de/yagee/test
 


Ironically „mvn javadoc:test-javadoc“ runs without any issues and without 
„test“ or „compile“ running before the „test-javadoc“ goal. No way to get it 
working during „mvn site“ though!

kind regards

Thomas

> Am 29.10.2020 um 15:57 schrieb Benjamin Marwell :
> 
> Hi Thomas,
> 
> | Exit code: 2 - javadoc: error - No source files for package de.yagee.test
> 
> You do not have a folder "/project/src/test/java" with any test sources!
> 
> I set up an example here:
> https://github.com/FIUS/jvk/pull/123/files
> 
> Please be aware that you still cannot create test javadocs nor javadoc
> from dependency sources. As said, please kindly create two issues for
> this.
> 
> Am Do., 29. Okt. 2020 um 08:10 Uhr schrieb Thomas Scheffler
> :
>> 
>> Hi Benjamin,
>> 
>> you may have done something differently because „mvn test site“ does not 
>> work here. Could you recheck or give me a hint, what I could have done wrong?
>> 
>> kind regards,
>> 
>> Thomas
>> 
>>> Am 28.10.2020 um 20:05 schrieb Benjamin Marwell :
>>> 
>>> Hi Thomas,
>>> 
>>> no worry, that is as easy to fix as the previous one.
>>> 
>>> Read carefully:
 Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork
>>> 
>>> The javadoc-plugin executes "test-aggregate-no-fork".
>>> 
>>> Which means: It creates javadoc for your TEST classes from src/test/java.
>>> That again requires the "test" goal to be run first [1].
 Requires dependency resolution of artifacts in scope: test.
>>> 
>>> I rarely found it useful to generate, validate and publish javadoc for
>>> test classes.
>>> 
>>> Long story short:
>>> mvn test site # (test includes compile).
>>> 
>>> Although imho, you will always want to execute "mvn verify" (or "mvn
>>> clean verify") anyway, wouldn’t you? ;-)
>>> This is considered a good habit by Robert Scholte iirc.
>>> 
>>> If you need more information on the "why", don’t hesitate to ask! :)
>>> 
>>> [1] 
>>> https://maven.apache.org/plugins/maven-javadoc-plugin/test-aggregate-no-fork-mojo.html
>>> 
>>> Am Mi., 28. Okt. 2020 um 14:45 Uhr schrieb Thomas Scheffler
>>> :
 
 Hi,
 
 thanks for looking into it. I updated the project a bit so that you can 
 easily switch the version with „-Djavadoc.plugin.version=3.0.1“ to see it 
 working nice with „mvn site“ and „mvn javadoc:javadoc“. My problem is, 
 that I don’t know how to make „site“ run again. „mvn compile site“ will 
 prevent the errors for the main javadocs but will fail on test javadocs 
 (Junit tests):
 
 [ERROR] Failed to execute goal 
 org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on 
 project test: Error generating 
 maven-javadoc-plugin:3.2.0:test-aggregate-no-fork report:
 [ERROR] Exit code: 2 - javadoc: error - No source files for package 
 de.yagee.test
 [ERROR]
 [ERROR] Command line was: /Users/yagee/Java/Home/14/bin/javadoc @options 
 @packages
 [ERROR]
 [ERROR] Refer to the generated Javadoc files in 
 '/Users/yagee/git/javadoc-test/target/site/testapidocs' dir.
 [ERROR] -> [Help 1]
 
 I can stick with 3.0.1 for a while, but of cause I want to move forward. I 
 set up the minimal project to get this figured out, but I lost.
 
 Looking at 
 https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html, there is 
 even no hint on suddenly requiring „compile“ starting with version 1.1.0. 
 Still the site issue drives me nuts, too.
 
 Thanks again for helping me!
 
 kind regards,
 
 Thomas
 
 Am 27.10.2020 um 19:55 schrieb Benjamin Marwell :
 
 Hi Thomas,
 
 I tested your configuration and found the same issue – however, it may
 not be an issue after all.
 
 You configured your javadoc plugin as part of the reporting section.
 This usually requires the compile goal.
 
 Even if you add the jar goal to the default build->plugin section, it
 will still require compile to be executed. This is expected and
 documented in [2]:
 "Requires dependency resolution of artifacts in scope: compile. &&
 Binds by default to the lifecycle phase: package."
 
 Same description for the javadoc:javadoc goal.
 
 "mvn package site" will work because "package" includes the "compile"
 goal from the default lifecycle.
 
 site (on its own) however is it's own lifecycle and goal and does not
 contain the default's lifecycle compile goal. See [1].
 
 Everything you reported works as expected. From what I can tell it
 shouldn’t have worked with other java versions and/or other javadoc
 plugin versions either.
 
 Does this help you? If not, maybe you might want to explain your
 execut

Re: No transfer protocol found

2020-10-30 Thread Bernd Eckenfels
Did you specify „repo“ as the url? I think it needs a valid URL here.


--
http://bernd.eckenfels.net

Von: Raivo Rebane 
Gesendet: Friday, October 30, 2020 2:27:05 PM
An: users@maven.apache.org 
Betreff: No transfer protocol found

Hello

I have trouble

I tried mvn deploy:deploy-file in different ways:

as example mvn deploy:deploy-file -Durl=repo
-Dfile=/opt/tomcat/latest/lib/or.jar -DgroupId=com.appserv
-DartifactId=devlib -Dpackaging=jar -Dversion=0.1
-Dmaven.wagon.provider.http=wagon-file

But in any cases I got error:

Failed to execute goal
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file
(default-cli) on project AppServ: No transfer protocol found.

What is wrong ?

Regards

Raivo



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



No transfer protocol found

2020-10-30 Thread Raivo Rebane

Hello

I have trouble

I tried mvn deploy:deploy-file in different ways:

as example mvn deploy:deploy-file -Durl=repo 
-Dfile=/opt/tomcat/latest/lib/or.jar -DgroupId=com.appserv 
-DartifactId=devlib -Dpackaging=jar -Dversion=0.1 
-Dmaven.wagon.provider.http=wagon-file


But in any cases I got error:

Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file 
(default-cli) on project AppServ: No transfer protocol found.


What is wrong ?

Regards

Raivo



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