Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus / Maven - The POM for ... is missing, no dependency information available

I'm facing a bunch of warnings like "The POM for ... is missing, no dependency information available" while building my maven java project.

The artifacts are stored in the Nexus server hosted in our company. The problem started after I scheduled a task in Nexus to "Remove Releases From Repository" in order to clean up it and maintain only the 2 last releases.

Because of that, I'm receiving these warnings for the old-removed releases:

[WARNING] The POM for xpto:jar:jar:8.16.1 is missing, no dependency information available
[WARNING] The POM for xpto:jar:jar:8.17.0 is missing, no dependency information available
[WARNING] The POM for xpto:jar:jar:8.18.0 is missing, no dependency information available
[WARNING] The POM for xpto:jar:jar:8.19.0 is missing, no dependency information available

Once I have many component projects and the releases are constants, when a compile some project that use these components, I get a lot of warnings like that.

Do you guys propose some way to avoid these warning or execute some goal at client side that could re-resolve or reindex the dependencies?

Regards,

like image 488
Danilo Muñoz Avatar asked Feb 05 '15 16:02

Danilo Muñoz


1 Answers

Sometimes Releases are Disposable

As the article above describes, depending on your business, you may not need to store old releases on your own repository. I'm included in this scenario.

In order to maintain, for example, only the 2 last releases from my component projects, some steps should be followed in order to avoid the maven [WARNING] messages:

1. Remove releases from repository

You should add a task to your repository to maintain the only n release itens. This can be done by:

  • Go to Sonatype Nexus > Administration > Scheduled Tasks > Add
  • Set "Task Type" to "Remove Releases From Repository"
  • Setup your own parameters (e-mail, recurrence, etc.)

2. Rebuild maven metadata files

The "ace in the hole" for this question is to rebuild the maven metadata files (maven-metadata.xml), once they were going to maintain the old releases information until the time they are going to be rebuild. This can be done by:

  • Go to Sonatype Nexus > Administration > Scheduled Tasks > Add
  • Set "Task Type" to "Rebuild Maven Metadata Files"
  • Setup your own parameters (e-mail, recurrence, etc.)
  • Attention: this task must run after the "Remove Releases From Repository"

3. Local repository

Now, the local repository need to know that metadata files were updated. This can be done by the parameter:

  • mvn -U:

    -U,--update-snapshots Forces a check for updated releases and snapshots on remote

  • For example:

    mvn -U clean package

References

  • Can I delete releases from Nexus after they have been published?
  • What do the scheduled tasks in Nexus do, and how often should I run them?
  • How to force maven to update local repo
like image 155
Danilo Muñoz Avatar answered Nov 15 '22 22:11

Danilo Muñoz