RE: Unable to resolve artifact error when trying to transfer ISO using pom.xml

2021-08-04 Thread christopher.mil...@gd-ms.com


Looks like I can use the following command to determine the version number of 
Maven plugings:  mvn dependency:tree -Dverbose 


--- maven-dependency-plugin:2.8:tree (default-cli) @ --- 


Probably would be wise to install the latest Dependency Plugin 3.2.0

Thanks



-Original Message-
From: Greg Chabala  
Sent: Tuesday, August 3, 2021 3:57 PM
To: Maven Users List 
Subject: Re: Unable to resolve artifact error when trying to transfer ISO using 
pom.xml


External E-mail --- CAUTION: This email originated from outside GDMS. Do not 
click links or open attachments unless you recognize the sender and know the 
content is safe.

Ah, I missed your inline question about plugin versions. In general they are 
independent of the maven version, and you should feel free to upgrade to the 
latest version for any plugin.

https://maven.apache.org/plugins/maven-dependency-plugin/ is at 3.2.0.

https://www.mojohaus.org/versions-maven-plugin/ has a display-plugin-updates 
goal, along with other similar goals that can help you check if your project 
plugins are up to date.

On Tue, Aug 3, 2021 at 2:09 PM Greg Chabala  wrote:

> For reference: https://maven.apache.org/pom.html
>
> You want your Nexus configured in the top level repositories tag, not 
> in distributionManagement.
>
> On Tue, Aug 3, 2021 at 2:00 PM christopher.mil...@gd-ms.com < 
> christopher.mil...@gd-ms.com> wrote:
>
>>
>> Sorry, I forgot to include the Nexus repo in the pom.xml
>>
>> 
>>   
>> false
>> ID_GOES_HERE
>> ID_GOES_HERE
>> Nexus_repo_url_copied_here>
>> default
>>   
>> 
>>
>>
>> I'm copying the URL directly from the Nexus repo directly into the 
>>  tags.
>>
>> thanks
>>
>>
>> -Original Message-
>> From: Greg Chabala 
>> Sent: Tuesday, August 3, 2021 2:41 PM
>> To: Maven Users List 
>> Subject: Re: Unable to resolve artifact error when trying to transfer 
>> ISO using pom.xml
>>
>> 
>> External E-mail --- CAUTION: This email originated from outside GDMS. 
>> Do not click links or open attachments unless you recognize the 
>> sender and know the content is safe.
>>
>> Your ISO will not be in Central. If it is, you can tell us the 
>> coordinates.
>>
>> You need your Nexus repository configured in the pom.xml so that 
>> Maven can find the artifacts.
>>
>> On Tue, Aug 3, 2021 at 1:25 PM christopher.mil...@gd-ms.com < 
>> christopher.mil...@gd-ms.com> wrote:
>>
>> >
>> > I was able to get a working pom.xml in our development environment, 
>> > however when I transferred this pom to an production, air-gapped 
>> > environment, it continues to output the following error:  unable to 
>> > resolve artifact
>> >
>> > I am not a software developer, I'm a system engineer and a lot of 
>> > the pom.xml files that I've inherited aren't uniform between each 
>> > other, so please bear with me as I've been trying to figure this 
>> > out for
>> months.
>> >
>> > Environment:
>> > RHEL 8.2 OS
>> > Apache Maven 3.5.4 (currently installed) Java Version:  1.8.0_222 
>> > (currently installed and added java path to my .bashrc file under 
>> > my home directory and output of $JAVA_HOME shows 
>> > /etc/alternatives/jre_1.8.0_openjdk.  Not sure if this is the Java 
>> > that I'm supposed to use, however I don't get any type of Java 
>> > errors when trying to run this.)
>> >
>> >
>> > When I execute the pom with the following command:  mvn 
>> > dependency:copy -f pom.xml -s ~/.m2/settings.xml
>> >
>> > This is some of the output that I'm getting, the download part is 
>> > odd, as it has the group ID, artifact ID and version ID along with 
>> > the name of the ISO I'm trying to download from a Nexus repo.
>> >
>> > "Downloading from central:  https://repo.maven.apache.org/maven2/
>> > ///> > https://repo.maven.apache.org/maven2/%3cgroupID%3e/%3cartifactID%3e
>> > /%3 cversionID%3e%3crelease_number%3e/%3cname>
>> > of ISO here>
>> >
>> > Error failed to execute goal
>> > org.apache.maven.plugins:maven-dependency-plugin:2.8copy 
>> > (default-cli) on Project : Unable to resolve 
>> > artifact Could not transfer artifact 
>> > ::iso:
>> > from/to central
>> > (https://repo.maven.apache.org/maven2):
>> > repo.maven.apache.org: Name or service not known"
>> >
>> >
>> > Here is my pom.xml.  I've modeled this after the best practice put 
>> > out by apache/maven for using dependency:copy
>> >
>> >
>> > https://maven.apache.org/plugins/maven-dependency-plugin/examples/c
>> > opy
>> > ing-artifacts.html
>> >
>> > 4.0.0
>> >
>> > group_ID_here
>> > artifact_ID_here
>> > version_of_iso
>> >
>> > 
>> >   /dropbox/
>> > 
>> >
>> > 
>> >   
>> >  
>> > org.apache.maven.plugins
>> > maven-dependency-plugin
>> > 2.8
>> >  > > what version number this is suppose to be and will work correctly 
>> > with the version of Maven that I have?
>> >
>> >  
>> >
>> >  ${project.groupId}
>> >  

RE: Unable to resolve artifact error when trying to transfer ISO using pom.xml

2021-08-04 Thread christopher.mil...@gd-ms.com


The workstation where I was having these Maven issues has crashed and will take 
a day to rebuild.  

I will have to re-install Maven (will want to match my dev environment along 
with having the same plugins). 

Once back up and running, I'll try again and respond back if successful or not. 

Thanks


-Original Message-
From: Greg Chabala  
Sent: Tuesday, August 3, 2021 3:10 PM
To: Maven Users List 
Subject: Re: Unable to resolve artifact error when trying to transfer ISO using 
pom.xml


External E-mail --- CAUTION: This email originated from outside GDMS. Do not 
click links or open attachments unless you recognize the sender and know the 
content is safe.

For reference: https://maven.apache.org/pom.html

You want your Nexus configured in the top level repositories tag, not in 
distributionManagement.

On Tue, Aug 3, 2021 at 2:00 PM christopher.mil...@gd-ms.com < 
christopher.mil...@gd-ms.com> wrote:

>
> Sorry, I forgot to include the Nexus repo in the pom.xml
>
> 
>   
> false
> ID_GOES_HERE
> ID_GOES_HERE
> Nexus_repo_url_copied_here>
> default
>   
> 
>
>
> I'm copying the URL directly from the Nexus repo directly into the 
>  tags.
>
> thanks
>
>
> -Original Message-
> From: Greg Chabala 
> Sent: Tuesday, August 3, 2021 2:41 PM
> To: Maven Users List 
> Subject: Re: Unable to resolve artifact error when trying to transfer 
> ISO using pom.xml
>
> 
> External E-mail --- CAUTION: This email originated from outside GDMS. 
> Do not click links or open attachments unless you recognize the sender 
> and know the content is safe.
>
> Your ISO will not be in Central. If it is, you can tell us the coordinates.
>
> You need your Nexus repository configured in the pom.xml so that Maven 
> can find the artifacts.
>
> On Tue, Aug 3, 2021 at 1:25 PM christopher.mil...@gd-ms.com < 
> christopher.mil...@gd-ms.com> wrote:
>
> >
> > I was able to get a working pom.xml in our development environment, 
> > however when I transferred this pom to an production, air-gapped 
> > environment, it continues to output the following error:  unable to 
> > resolve artifact
> >
> > I am not a software developer, I'm a system engineer and a lot of 
> > the pom.xml files that I've inherited aren't uniform between each 
> > other, so please bear with me as I've been trying to figure this out for 
> > months.
> >
> > Environment:
> > RHEL 8.2 OS
> > Apache Maven 3.5.4 (currently installed) Java Version:  1.8.0_222 
> > (currently installed and added java path to my .bashrc file under my 
> > home directory and output of $JAVA_HOME shows 
> > /etc/alternatives/jre_1.8.0_openjdk.  Not sure if this is the Java 
> > that I'm supposed to use, however I don't get any type of Java 
> > errors when trying to run this.)
> >
> >
> > When I execute the pom with the following command:  mvn 
> > dependency:copy -f pom.xml -s ~/.m2/settings.xml
> >
> > This is some of the output that I'm getting, the download part is 
> > odd, as it has the group ID, artifact ID and version ID along with 
> > the name of the ISO I'm trying to download from a Nexus repo.
> >
> > "Downloading from central:  https://repo.maven.apache.org/maven2/
> > /// > https://repo.maven.apache.org/maven2/%3cgroupID%3e/%3cartifactID%3e/
> > %3 cversionID%3e%3crelease_number%3e/%3cname>
> > of ISO here>
> >
> > Error failed to execute goal
> > org.apache.maven.plugins:maven-dependency-plugin:2.8copy 
> > (default-cli) on Project : Unable to resolve 
> > artifact Could not transfer artifact 
> > ::iso:
> > from/to central
> > (https://repo.maven.apache.org/maven2):
> > repo.maven.apache.org: Name or service not known"
> >
> >
> > Here is my pom.xml.  I've modeled this after the best practice put 
> > out by apache/maven for using dependency:copy
> >
> >
> > https://maven.apache.org/plugins/maven-dependency-plugin/examples/co
> > py
> > ing-artifacts.html
> >
> > 4.0.0
> >
> > group_ID_here
> > artifact_ID_here
> > version_of_iso
> >
> > 
> >   /dropbox/
> > 
> >
> > 
> >   
> >  
> > org.apache.maven.plugins
> > maven-dependency-plugin
> > 2.8
> >   > version number this is suppose to be and will work correctly with 
> > the version of Maven that I have?
> >
> >  
> >
> >  ${project.groupId}
> >  artifact_ID_goes_here
> >  ${project.version
> >  iso
> >  false
> >  ${depStagingArea}
> >  ${downloadFilename}
> >
> >  
> >
> >  
> >
> >  
> >
> >
> > This is my settings.xml file
> >
> > 
> > 
> >   
> > ID_goes_here
> > username_goes_here
> > password_goes_here
> > 664
> > 775
> >   
> > 
> >
> > 
> >   
> > nexus
> >  
> >  
> >ID_goes_here
> >URL_goes_here
> >true
> > 
> 

[Enforcer Plugin] DependencyConvergence of a "provided" deendency?

2021-08-04 Thread Niels Basjes
Hi,

I ran into a significant difference between maven-enforcer-plugin
versions 3.0.0-M3 and 3.0.0 in the way "provided" dependencies are handled.
I'm wondering if this is intended (and I would like to understand why) or a
regression which should be reported.

I have several projects (reusable libraries) where I have optional support
for Kryo ( https://github.com/EsotericSoftware/kryo ) which is a
serialization system that is sometimes needed.

In my library (LIB-1) I have Kyro code that is only reached IFF kryo is
present (via Annotations) and something like this in my pom.xml file.


  com.esotericsoftware
  kryo
  5.0.0
  provided


In a second library (LIB-2) I have two dependencies: LIB-1 and a different
version of Kryo in essentially the same way.


  com.esotericsoftware
  kryo
  5.1.1/version>
  provided



In the pom.xml of the LIB-2 I have this

  
 

  org.apache.maven.plugins
  maven-enforcer-plugin

  3.0.0
  

  dependency-convergence
  validate
  
enforce
  
  

  

  

  

  
  



If I run this plugin with version 3.0.0-M3 it all passes and finds these
dependencies correct.
With version 3.0.0 my build now fails with:

[WARNING]
Dependency convergence error for
com.esotericsoftware:kryo:jar:5.0.0:provided paths to dependency are:
+-com.example.application:myapp:jar:1.0-SNAPSHOT
  +-nl.example.library:mylib:jar:1.0-SNAPSHOT:compile
+-com.esotericsoftware:kryo:jar:5.0.0:provided
and
+-com.example.application:myapp:jar:1.0-SNAPSHOT
  +-com.esotericsoftware:kryo:jar:5.1.1:provided


I would love to understand.
Thanks.

-- 
Best regards / Met vriendelijke groeten,

Niels Basjes