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 [email protected] < [email protected]> wrote: > > Sorry, I forgot to include the Nexus repo in the pom.xml > > <distributionManagement> > <repository> > <uniqueVersion>false</uniqueVersion> > <id>ID_GOES_HERE</id> > <name>ID_GOES_HERE</name> > <url>Nexus_repo_url_copied_here></url> > <layout>default</layout> > </repository> > </distributionManagement> > > > I'm copying the URL directly from the Nexus repo directly into the <url> > tags. > > thanks > > > -----Original Message----- > From: Greg Chabala <[email protected]> > Sent: Tuesday, August 3, 2021 2:41 PM > To: Maven Users List <[email protected]> > 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 [email protected] < > [email protected]> 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/ > > <groupID>/<artifactID>/<versionID><release_number>/<name< > > 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 <artifactID here>: Unable to resolve artifact Could not > > transfer artifact <groupid>:<artifactid>:iso:<version_number> > > 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/copy > > ing-artifacts.html > > > > <modeVersion>4.0.0</modeVersion> > > > > <groupId>group_ID_here</groupId> > > <artifactId>artifact_ID_here</artifactId> > > <version>version_of_iso</version> > > > > <properties> > > <depStagingArea>/dropbox/</depStagingArea> > > </properties> > > > > <build> > > <plugins> > > <plugin> > > <groupId>org.apache.maven.plugins</groupId> > > <artifactId>maven-dependency-plugin</artifactId> > > <version>2.8</version> > > <------------------------------------------------How do I know what > > version number this is suppose to be and will work correctly with the > > version of Maven that I have? > > <configuration> > > <artifactItems> > > <artifactItem> > > <groupId>${project.groupId}</groupId> > > <artifactId>artifact_ID_goes_here</artifactId> > > <version>${project.version</version> > > <type>iso</type> > > <overWrite>false</overWrite> > > <outputDirectory>${depStagingArea}</outputDirectory> > > <destFileName>${downloadFilename}</destFileName> > > </artifactItem> > > </artifactItems> > > </configuration> > > </plugin> > > </plugins> > > </build> > > > > > > This is my settings.xml file > > > > <settings xmlns = > > > <servers> > > <server> > > <id>ID_goes_here</id> > > <username>username_goes_here</username> > > <password>password_goes_here</password> > > <filePermissions>664</filePermissions> > > <directoryPermission>775</directoryPermission> > > </server> > > </servers> > > > > <profiles> > > <profile> > > <id>nexus</id> > > <repositories> > > <repository> > > <id>ID_goes_here</ID> > > <URL>URL_goes_here</URL> > > <releases><enabled>true</enabled></releases> > > </repository> > > </repositories> > > </profile> > > </profiles> > > </settings> > > > > > > Thanks > > > > Chris > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
