天道酬勤,学无止境

nexus

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

2021-11-28 19:57:07    分类:问答    java   maven   pom.xml   nexus

How to index a Maven repo without Nexus/Artifactory/etc?

I run my own little Maven repo for some open source. I have no dedicated server so I use a Google code repository, deploy to file system and then commit and push. Works perfect for me. But some Maven tools are looking for a nexus-maven-repository-index.properties and the index (in GZ). I would like to generate this index to get rid of the warning that it's not here Maven doesn't try the repo for artefacts that are not there. How can I do that? Is there a tool (Java main) that is able to generate an index? Also tips how to use the proper Nexus Jars with a little commandline tool are welcome.

2021-11-28 18:55:23    分类:问答    maven   repository   nexus   maven-indexer

多个存储库的 Maven 设置(Maven Settings for multiple repositories)

问题 我在 settings.xml 中有以下内容 <mirrors> <mirror> <id>paid-jars</id> <name>jars with license</name> <url>http://url:8081/nexus/content/repositories/paidjars/</url> <mirrorOf>!central</mirrorOf> </mirror> <mirror> <id>Org-central</id> <name>mirror of central</name> <url>http://url:8081/nexus/content/repositories/central/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> 在 pom.xml 我有两个罐子 apache-commons.jar(我假设是从中央下载的) license.jar(我假设是从付费 jars 下载的) 但是当我运行maven clean install它会尝试从 Org-central 下载 license.jar。 我怎样才能让它使用付费罐子下载? 是否有可能首先它转到 Org-central,如果失败,它会尝试付费罐? 如果是这样,如何? 我不想在 pom.xml 中放置 repo 条目

2021-11-28 15:48:31    分类:技术分享    java   build   repository   maven-3   nexus

如何自动将战争从 Nexus 部署到 Tomcat?(How can I automatically deploy a war from Nexus to Tomcat?)

问题 如何自动将战争从 Nexus 部署到 Tomcat? 我有一个 maven web 项目,它在 Nexus 上成功构建和部署(包括 SNAPSHOT 和发布版本)。 我想知道 Nexus 中是否有功能/插件可以选择已发布的战争并自动部署在远程 Tomcat 上? 我知道您可以使用 maven-tomcat-plugin 将战争部署到远程 Tomcat,但想知道是否有替代解决方案。 请指导。 回答1 通常,您会使用像 Jenkins 这样的 CI 工具来运行 Maven 构建,该构建将您的 War 文件发布到 Nexus 中。 Nexus 将被您用来将 War 推送到目标 tomcat 环境的任何工具使用: 有很多很多的选择。 Jenkins 后构建 SSH 脚本 从 Jenkins 运行构建后的 SSH 任务,在目标 tomcat 服务器上执行以下操作: curl "http://myrepo/nexus/service/local/artifact/maven/redirect?r=releases&g=myorg&a=myapp&v=1.1&e=war" \ -o /usr/local/share/tomcat7/webapps/myapp.war service tomcat7 restart 跑台 我更喜欢使用 Rundeck 进行部署,因为它有一个 Nexus 插件

2021-11-28 03:17:38    分类:技术分享    java   maven   tomcat   nexus

Avoiding maven repository version collision when using feature branches

Question: How do you handle feature branches for maven multi project builds? Jenkins builds and deploys these branches to keep build overhead on developers to a minimum but develop and feature branches cannot build the same maven version or we risk mismatch between artifacts and source. We have a script to change parent version in child poms and version in root pom. While this segregates the branches in maven space, it results in extra work when merging. I think nexus pro staging feature might help us avoid this requirement and make each feature branch use a specific repo which we easily drop

2021-11-28 00:33:36    分类:问答    maven   jenkins   maven-3   nexus   git-flow

How to set _auth for a scoped registry in .npmrc?

I am wondering how to configure the .npmrc file so that I can have a default registry and a different scoped registry with authentication. I am using Nexus for the private repository and I am not sure how to set authentication for the scoped registry, only the default registry. For example my ~/.npmrc file is: registry=https://registry.npmjs.org/ @test-scope:registry=http://nexus:8081/nexus/content/repositories/npm-test/ email=test@user.com _auth="…" If I do npm publish for a package scoped to test-scope, I get an authentication error. AFAIK, the _auth only applies to the registry=... section

2021-11-27 21:38:14    分类:问答    node.js   authentication   npm   nexus   npm-publish

Get size of specific repository in Nexus 3

How can I get a size of specific repository in Nexus 3? For example, Artifactory shows the repository "size on disk" via UI. Does Nexus have something similar? If not - how can I get this information by script?

2021-11-27 18:13:22    分类:问答    nexus   nexus3

Nexus Artifacts Uploading

How to upload artifacts to nexus with auto generating the version by using jenkins shell? I am using this script and I want to generate the version automatically when artifact uploading. mvn deploy:deploy-file \ -DgroupId= \ -DartifactId= \ -Dversion= \ -DgeneratePom= \ -Dpackaging= \ -DrepositoryId= \ -Durl= \ -Dfile=

2021-11-27 08:13:25    分类:问答    git   maven   jenkins   gitlab   nexus

使用 Maven 元数据发布 Ivy SNAPSHOTS(Publishing Ivy SNAPSHOTS with Maven metadata)

问题 我有一个 Ivy 项目,它将其工件发布到 Nexus Maven 存储库。 然后我需要其他 Maven 项目才能使用这些 jar 作为依赖项。 我已经能够让 Ivy 创建和上传 pom.xml 以及 jars,这工作正常。 问题是,当我使用 Ivy 发布新的 SNAPSHOT 版本时 - 即使我这样做,Maven 项目也不会检索新的快照依赖项: mvn clean install -U 我注意到 Ivy 没有将 maven-metadata.xml 文件发布到存储库——我认为这是问题所在? 如果是这样,有什么方法可以让 Ivy 生产这个吗? 回答1 ivy可以配置在解析依赖时读取这个文件(查看ibilio解析器的“m2compatible”属性),但是publish任务不会创建或者更新这个文件..... 创建和更新“maven-metadata.xml”文件似乎是客户端的工作......这是Maven存储库的未记录功能。 (如果有人能找到它描述的地方,也许可以修复一个常春藤错误)。 标准的解决方法是定期安排 Nexus 任务以重新生成元数据文件。 看: http://www.sonatype.com/people/2009/09/nexus-scheduled-tasks/ 更极端的解决方案是使用 Maven ANT 任务来执行发布步骤.... 对快照修订的评论

2021-11-26 14:12:24    分类:技术分享    maven   nexus   ivy   maven-metadata

m2e 无法从 nexus 传输元数据,但 maven 命令行可以(m2e cannot transfer metadata from nexus, but maven command line can)

问题 我正在使用 nexus 来托管我的 maven 存储库,并且 maven 命令行(win32 和 linux)可以使用相同的命令和相同的 setting.xml 从这个 nexus 成功传输工件。 但是 m2e 会失败,如下所示: [WARNING] Could not transfer metadata m3-app:m3:1.0-SNAPSHOT/maven-metadata.xml from/to Nexus (http://1.2.3.4:8080/nexus/content/groups/public): Failed to create a selector. to http://1.2.3.4:8080/nexus/content/groups/public/m3-app/m3/1.0-SNAPSHOT/maven-metadata.xml [WARNING] Failure to transfer m3-app:m3:1.0-SNAPSHOT/maven-metadata.xml from http://1.2.3.4:8080/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update

2021-11-26 08:10:49    分类:技术分享    eclipse   maven   nexus   m2e