J'ai une instance Nexus avec des référentiels Maven 2 hébergés sur un domaine de développement d'entreprise non connecté à Internet. J'ai besoin d'utiliser le plugin maven-jaxb-schemagen de Sun, cependant, il n'était disponible qu'au format Maven 1 (avec beaucoup d'autres dépendances Maven 1, ce n'est donc pas un cas unique).Le référentiel Nexus contient un artefact mais ne rend disponible POM.
J'ai fait une nouvelle Maven 1 hébergé dans Nexus référentiel (maven1), puis fait un dépôt virtuel Maven1 à Maven2 ainsi (maven1as2). Parce que certains des artefacts nécessaires sont des instantanés, la stratégie pour maven1 (et par extension maven1as2) est Snapshot.
J'ai importé tous les artefacts Maven 1 via le système de fichiers vers l'emplacement de stockage local surchargé de ce référentiel.
J'ai ensuite ajouté maven1as2 à mon Public Repositories groupe. Une partie de la référence que j'ai trouvée indique que Nexus ne vous permettra pas de parcourir ou de rechercher un référentiel Maven1. J'ai eu des résultats mitigés. Si je sélectionne Public Repositories ou maven1as2 dans Nexus, je peux aller à Parcourir stockage et percez jusqu'à com/soleil/outils/JXC/maven2/maven-JAXB-schemagen-plugin/1.3-snapshot/ et affichez le fichier maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom et sa somme de contrôle. Cependant, je ne peux pas voir l'artefact JAR qui devrait être présent et qui se trouve sur le système de fichiers.
Lorsque je tente d'utiliser Maven pour construire, je reçois les éléments suivants:
$ mvn clean compile
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] MyProject
[INFO] MyModule1
[INFO] MyModule2
...
[INFO] ---------------------------------------------------------------------------
[INFO] Building MyProject
[INFO] task-segment: [clean, compile]
[INFO] ---------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [cobertura:clean {execution: default}]
[INFO] No goals needed for project - skipping
[INFO] ---------------------------------------------------------------------------
[INFO] Building MyModule1
[INFO] task-segment: [clean, compile]
[INFO] ---------------------------------------------------------------------------
Downloading: http://my.nexus.server:8081/nexus/content/groups/public/com/sun/tools/jxc/maven2/maven-jaxb-schemagen-plugin/1.3-SNAPSHOT/maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom
6K downloaded (maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom)
[INFO] ---------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ---------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.sun.tools.jxc.maven2 -DartifactId=maven-jaxb-schemagen-plugin -Dversion=1.3-SNAPSHOT -Dpackaging=maven-plugin -Dfile=path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun.tools.jxc.maven2 -DartifactId=maven-jaxb-schemagen-plugin -Dversion=1.3-SNAPSHOT -Dpackaging=maven-plugin -Dfile=path/to/file -Durl=[url] -DrepositoryId=[id]
com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.3-SNAPSHOT
from the specified remote repositories:
nexus (http://my.nexus.server:8081/nexus/content/groups/public)
com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.3-SNAPSHOT
from the specified remote repositories:
nexus (http://my.nexus.server:8081/nexus/content/groups/public)
[INFO] ---------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ---------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Jul 06 15:05:08 EDT 2010
[INFO] Final Memory: 7M/17M
[INFO] ---------------------------------------------------------------------------