Re: exec:java doesn't find classes from jar files

2020-10-31 Thread Bernd Eckenfels
Hello,

I don't think it is a good idea to repackage or relocate common external 
libraries. It looks like you moved everything to groupid=lib, this is a not 
very common Maven usage. I am not saying you can't get it to work, but it needs 
some advanced skills and it is unlikely we can easily help you.

This might also be the reason why your transitive dependencies are no longer 
detected automatically, because you don't have the upstream POMs.

Your particular error seems to be an effect of that,  maybe mixing different 
library versions.

You can try to debug it by looking at "mvn dependency:tree"

Gruss
Bernd


--
http://bernd.eckenfels.net

Von: Raivo Rebane 
Gesendet: Saturday, October 31, 2020 2:20:21 PM
An: users@maven.apache.org 
Betreff: Re: exec:java doesn't find classes from jar files

Hello

My pom is as follows:

http://maven.apache.org/POM/4.0.0;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd;>
 4.0.0

 1
 p0
 0.0.1

 A Solr project
 http://www.devonlinux.net

 
 3.r4.0
 8983
 


   
 project.local
 project
 file:${project.basedir}/repo
   


 

 
   lib
   solrj
   1.0
 


 
   lib
   httpclient
   1.0
 

 
   lib
   httpcore
   1.0
 


 
   lib
   codec
   1.0
 

 
   lib
   logging
   1.0
 

 
   lib
   httpclient-beta
   1.0
 

 
   lib
   apache-httpmime
   1.0
 

 
   lib
   slf4j
   1.0
 

 
   lib
   logback-classic
   1.0
 

 
   lib
   logback-core
   1.0
 

 

 

 
 
src/main/resources
 true
 
 

 


 
 org.apache.maven.plugins
 maven-compiler-plugin
 
 1.7
 1.7
 
 

 
 org.mortbay.jetty
maven-jetty-plugin
 6.1.25
 
10
 foo
 
 /solr
 
 
 ${solr.port}
6
 
 
 
 
 solr.data.dir
 target/data
 
 
 
 
 
 start-jetty
pre-integration-test
 
 run
 
 
 true
 
 
 
 stop-jetty
post-integration-test
 
 stop
 
 
 
 


 
 org.owasp
dependency-check-maven
 6.0.2
 
true
true
 
 
 
 
 check
 
 
 
 

 
 org.easyb
maven-easyb-plugin
 1.3
 
 
integration-test
 
 test
 
 
 
 
${basedir}/src/test/stories
${project.build.directory}/easyb-stories.txt
${project.build.directory}/easyb-report.xml
 html
${project.build.directory}/acceptance/stories.html
 
 

 

 


And error message is as follows:

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.9, vendor: Ubuntu, runtime:
/usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-52-generic", arch: "amd64", family: "unix"
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by
com.google.inject.internal.cglib.core.$ReflectUtils$1
(file:/usr/share/maven/lib/guice.jar) to method
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of
com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal
refl

Re: exec:java doesn't find classes from jar files

2020-10-31 Thread Raivo Rebane

Hello

My pom is as follows:

http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd;>

    4.0.0

    1
    p0
    0.0.1

    A Solr project
    http://www.devonlinux.net

    
    3.r4.0
    8983
    


  
    project.local
    project
    file:${project.basedir}/repo
  


    

        
          lib
          solrj
          1.0
        


        
          lib
          httpclient
          1.0
        

        
          lib
          httpcore
          1.0
        


        
          lib
          codec
          1.0
        

        
          lib
          logging
          1.0
        

        
          lib
          httpclient-beta
          1.0
        

        
          lib
          apache-httpmime
          1.0
        

        
          lib
          slf4j
          1.0
        

        
          lib
          logback-classic
          1.0
        

        
          lib
          logback-core
          1.0
        

    

    

    
            
src/main/resources
                true
            
        

    


    
    org.apache.maven.plugins
    maven-compiler-plugin
    
    1.7
    1.7
    
    

    
    org.mortbay.jetty
maven-jetty-plugin
    6.1.25
    
10
    foo
    
    /solr
    
    implementation="org.mortbay.jetty.nio.SelectChannelConnector">

    ${solr.port}
6
    
    
    
    
    solr.data.dir
    target/data
    
    
    
    
    
    start-jetty
pre-integration-test
    
    run
    
    
    true
    
    
    
    stop-jetty
post-integration-test
    
    stop
    
    
    
    


    
    org.owasp
dependency-check-maven
    6.0.2
    
true
true
    
    
    
    
    check
    
    
    
    

    
    org.easyb
maven-easyb-plugin
    1.3
    
    
integration-test
    
    test
    
    
    
    
${basedir}/src/test/stories
${project.build.directory}/easyb-stories.txt
${project.build.directory}/easyb-report.xml
    html
${project.build.directory}/acceptance/stories.html
    
    

    

    


And error message is as follows:

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.9, vendor: Ubuntu, runtime: 
/usr/lib/jvm/java-11-openjdk-amd64

Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-52-generic", arch: "amd64", family: "unix"
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by 
com.google.inject.internal.cglib.core.$ReflectUtils$1 
(file:/usr/share/maven/lib/guice.jar) to method 
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of 
com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations

WARNING: All illegal access operations will be denied in a future release
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.annotation.* < plexus.core
[DEBUG]   Imported: javax.annotation.security.* < plexus.core
[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
[DEBUG]   Imported: javax.enterprise.util.* < plexus.core
[DEBUG]   Imported: javax.inject.* < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG]   

Re: exec:java doesn't find classes from jar files

2020-10-31 Thread Tomo Suzuki
Hi Raivo,

Interesting problem. Would you share the entire error message and minimum
reproducible pom.xml?

Tomo

On Sat, Oct 31, 2020 at 07:17 Raivo Rebane  wrote:

> Hello
>
> If I use single httpclient.jar it doesn't find HttpClient.class
>
> if I duplicate dependencies wuidth addisional httpclient-beta.jar it
> finds HttpClient.class
>
> Then it didn't find HttpClientConnectionManager.class witch exist in
> both jars :
>
> org/apache/http/conn/OperatedClientConnection.class
> org/apache/http/conn/ManagedClientConnection.class
> org/apache/http/conn/ConnectionRequest.class
> org/apache/http/conn/EofSensorInputStream.class
> org/apache/http/conn/ClientConnectionOperator.class
> org/apache/http/conn/HttpClientConnectionOperator.class
> org/apache/http/conn/BasicManagedEntity.class
> org/apache/http/conn/ConnectionKeepAliveStrategy.class
> org/apache/http/conn/ManagedHttpClientConnection.class
> org/apache/http/conn/BasicEofSensorWatcher.class
> org/apache/http/conn/HttpClientConnectionManager.class
> org/apache/http/conn/HttpRoutedConnection.class
> org/apache/http/conn/EofSensorWatcher.class
> org/apache/http/conn/SchemePortResolver.class
> org/apache/http/conn/ClientConnectionManager.class
>
> What to do ?
>
> Regrds
>
> Raivo
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
> --
Regards,
Tomo


exec:java doesn't find classes from jar files

2020-10-31 Thread Raivo Rebane

Hello

If I use single httpclient.jar it doesn't find HttpClient.class

if I duplicate dependencies wuidth addisional httpclient-beta.jar it 
finds HttpClient.class


Then it didn't find HttpClientConnectionManager.class witch exist in 
both jars :


org/apache/http/conn/OperatedClientConnection.class
org/apache/http/conn/ManagedClientConnection.class
org/apache/http/conn/ConnectionRequest.class
org/apache/http/conn/EofSensorInputStream.class
org/apache/http/conn/ClientConnectionOperator.class
org/apache/http/conn/HttpClientConnectionOperator.class
org/apache/http/conn/BasicManagedEntity.class
org/apache/http/conn/ConnectionKeepAliveStrategy.class
org/apache/http/conn/ManagedHttpClientConnection.class
org/apache/http/conn/BasicEofSensorWatcher.class
org/apache/http/conn/HttpClientConnectionManager.class
org/apache/http/conn/HttpRoutedConnection.class
org/apache/http/conn/EofSensorWatcher.class
org/apache/http/conn/SchemePortResolver.class
org/apache/http/conn/ClientConnectionManager.class

What to do ?

Regrds

Raivo


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