CodexBloom - Programming Q&A Platform

Maven build scenarios with 'Invalid artifact descriptor' scenarios when using custom repository

👀 Views: 72 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-13
maven nexus dependencies Java

Quick question that's been bugging me - I'm trying to implement I'm working with an scenario while trying to build my Maven project that uses a custom repository hosted on Nexus. The behavior message I receive is: ``` [behavior] Failed to execute goal on project my-app: Could not resolve dependencies for project com.example:my-app:jar:1.0-SNAPSHOT: Could not find artifact com.example:my-library:jar:1.0 in custom-repo (http://my-nexus-repo/repository/maven-releases/) -> [Help 1] ``` I've added the custom repository to my `pom.xml` like this: ```xml <repositories> <repository> <id>custom-repo</id> <url>http://my-nexus-repo/repository/maven-releases/</url> </repository> </repositories> ``` I have also verified that the artifact `com.example:my-library:jar:1.0` exists in the Nexus repository. I tried running `mvn clean install` with the `-U` flag to force updates, but the behavior continues. I've checked the repository URL and it's accessible from my machine. The scenario appears to be related to the artifact descriptor since I see this behavior even with a valid version. I also examined the settings in my `~/.m2/settings.xml`, but I don't see any misconfigurations there. For example: ```xml <mirrors> <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://my-nexus-repo/repository/maven-public/</url> </mirror> </mirrors> ``` I'm unsure if there's a specific configuration I might be missing or if there's a particular way artifacts should be deployed to Nexus. What steps can I take to troubleshoot this further, or is there a known scenario with artifacts not being resolved correctly from custom repositories? For context: I'm using Java on Debian. What's the correct way to implement this? This is for a web app running on Ubuntu 20.04. I'm open to any suggestions.