标签: artifactory

Maven:尝试使用settings.xml文件中的凭据进行部署

这似乎在上周工作,现在它没有.

  • 我们使用Artifactory作为我们的Maven存储库.
  • 我正在使用deploy:deploy-file目标部署jar和pom
  • 我们的Artifactory存储库需要部署身份验证.

我可以通过在命令行上将我的凭据嵌入服务器URL来部署到存储库:

 $ mvn deploy:deploy-file \
     -Durl=http://deployer:swordfish@repo.veggiecorp.com/artifactory/ext-release-local \
     -Dfile=crypto.jar \
     -DpomFile=pom.xml \
     -Did=VeggieCorp
  yadda...yadda...yadda...
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 0.962s
  [INFO] Finished at: Mon Aug 20 10:06:04 CDT 2012
  [INFO] Final Memory: 4M/118M
  [INFO] ------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

但是,整个部署会被记录,我的凭据将在日志中显示.因此,我希望能够在命令行上没有我的凭据进行部署.为此,我有一个$HOME/.m2/settings.xml文件:

<settings>
    <proxies>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>proxy.veggiecorp.com</host>
            <port>3128</port>
            <nonProxyHosts>*.veggiecorp.com</nonProxyHosts>
        </proxy>
    </proxies>
    <servers>
        <server>
            <id>VeggieCorp</id>
            <username>deployer</username>
            <password>swordfish</password>
        </server>
    </servers>
    <profiles>
        <profile>
            <id>VeggieCorp</id>
            <activation>
                 <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>VeggieCorp</id>
                    <name>VeggieCorp's Maven Repository</name>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy> …
Run Code Online (Sandbox Code Playgroud)

deployment settings artifactory maven

35
推荐指数
2
解决办法
5万
查看次数

如何从maven存储库中找到最新版本的工件

作为自动部署的一部分,我需要一个脚本从我们的内部存储库下载最新版本的工件.

理想情况下,此脚本将使用ant或unix shell脚本.

例如:

我有myArtifact.war,它有版本1.0,1.1和2.0 - 我需要给出正确的组ID和工件ID的脚本从我们的maven存储库中检索版本2.0(目前使用的是artifactory).

有没有简单的方法来做到这一点?

ant shell maven-2 artifactory

31
推荐指数
2
解决办法
2万
查看次数

Gradle artifactory插件说"无法投射对象'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention'......"

这是获取artifactory插件的配置:

buildscript {
    repositories {
        mavenCentral()
        maven { url 'http://jcenter.bintray.com' }
    }
    dependencies {
        classpath group:'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.0.1'
    }
}
apply plugin:'com.jfrog.artifactory'
apply plugin:'ivy-publish'

...some publish spec stuff...
Run Code Online (Sandbox Code Playgroud)

我跑gradle(2.3)然后我得到:

> Failed to apply plugin [id 'com.jfrog.artifactory']
   > Cannot cast object 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention@6b6c7be4' with class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention' to class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention'
Run Code Online (Sandbox Code Playgroud)

当然看起来像一个类路径问题,但我确实有这个项目和兄弟项目使用同一组gradle/artifactory配置,一个工作,另一个没有.两者都是同一顶级项目的一部分.相同的JDK(1.8.0_20).相同的Gradle.一切都一样.

我很困惑......

artifactory gradle

29
推荐指数
3
解决办法
5199
查看次数

npm 错误!无法验证,需要:Basic Realm=“Artifactory Realm”

我尝试运行命令:

\n
npm install -g @angular/cli@9.1.0\n
Run Code Online (Sandbox Code Playgroud)\n

但我有以下错误:

\n
\n

npm 错误!代码E401
\nnpm 错误!无法验证,需要:Basic Realm=“Artifactory Realm”

\n

npm 错误!此运行的完整日志可以在以下位置找到:
\nnpm ERR!/Users/xxxx/.npm/_logs/2021-08-10T19_33_12_063Z-debug.log

\n
\n

注意:node js 和 npm 工作正常。

\n

我已按照 Artifactory 中的说明使用以下命令解决此问题:

\n
npm config set registry https://artifactory.......com/artifactory/api/npm/xxxx/\n
Run Code Online (Sandbox Code Playgroud)\n

因为我已将以下内容粘贴到 ~/.npmrc 文件中:

\n
_auth = fhgf......ghgj==\nemail = xxx@xxx.com\nalways-auth = true\n
Run Code Online (Sandbox Code Playgroud)\n

我也尝试过使用npm login,但出现以下错误并且无法\xe2\x80\x99t 继续:

\n
\n

npm 登录
\n用户名:xxx@xxx.com
\nnpm 警告名称不能包含非 url 安全字符
\n用户名:(xxx@xxx.com)
\n用户名:(xxx@xxx.com)
\n用户名:(xxx@xxx .com)
\n用户名: (xxx@xxx.com)

\n
\n

我该如何解决这个问题?

\n

artifactory npm

29
推荐指数
3
解决办法
12万
查看次数

如何使用命令行将文件部署到Artifactory?

我花了很多时间在这上面,而不是承认.我试图从命令行将一个文件部署到我的Artifactory服务器中.我正在使用gradle这样做,因为这是我们管理Java构建的方式.但是,此工件是NDK/JNI构建工件,并且不使用gradle.

所以我只需要最简单的gradle脚本来进行部署.相当于:

scp <file> <remote>
Run Code Online (Sandbox Code Playgroud)

我目前正在尝试使用该artifactory插件,并且在查找插件的参考资料方面没什么好运的.

command-line artifactory gradle

28
推荐指数
5
解决办法
5万
查看次数

Maven无法从存储库获取SNAPSHOT构建

我们的内部存储库(Artifactory)现在包含稳定版本以及内部库的SNAPSHOT版本.

对于稳定版本,从存储库中下载任何内容从未出现过问题.

但是,当我添加-SNAPSHOT时,Maven声称无法找到依赖项,即使它最明确地存储在存储库中.

如果我在本地构建和部署依赖项(即进入我的本地存储库),所有工作都正常.

基本上,这有效:

<dependency>
  <groupId>com.example</groupId>
  <artifactId>ourlibrary</artifactId>
  <version>1.0.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

这不是:

<dependency>
  <groupId>com.example</groupId>
  <artifactId>ourlibrary</artifactId>
  <version>1.0.1-SNAPSHOT</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

即使两个版本都以相同的方式构建并且(正如我可能告诉的)正确地部署到存储库.

错误:

Missing:
----------

1) com.example:ourlibrary:jar:1.0.1-SNAPSHOT,

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.example -DartifactId=ourlibrary -Dversion=1.0.1-SNAPSHOT, -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.example -DartifactId=ourlibrary -Dversion=1.0.1-SNAPSHOT, -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) com.example:product:war:2.0.0-SNAPSHOT
        2) com.example:ourlibrary:jar:1.0.1-SNAPSHOT,
Run Code Online (Sandbox Code Playgroud)

虽然这听起来类似于这个问题,但到达那里的决议并不适用于我的情况.

任何有关这个问题的见解将不胜感激.

编辑

使用-X运行(如John V.所建议)显示以下内容: …

java maven-2 artifactory

27
推荐指数
2
解决办法
4万
查看次数

package-lock.json 中的 npm "resolved" 字段随着 JFrog artifactory 不断变化

我们有一个私有的 JFrog 工件(名称在下面匿名),它在项目根目录 .npmrc 文件中配置了 npm:

registry=https://artifactory.jfrog.private.com:443/api/npm/npm-registry-virtual/
Run Code Online (Sandbox Code Playgroud)

开发人员之间通过 Git 共享的 package-lock.json 文件中的已解析字段在“npm install”运行之间不断变化,而对 package.json 没有任何更改。

有时,一个 dl 查询参数(指向完全相同的 URL)被添加到解析的 URL 中:

- "resolved": "https://artifactory.jfrog.private.com:443/api/npm/npm-registry-virtual/@sailshq/lodash/-/lodash-3.10.3.tgz",
+ "resolved": "https://artifactory.jfrog.private.com:443/api/npm/npm-registry-virtual/@sailshq/lodash/-/lodash-3.10.3.tgz?dl=https://artifactory.jfrog.private.com/@sailshq/lodash/-/lodash-3.10.3.tgz",
Run Code Online (Sandbox Code Playgroud)

有时查询参数指向 npmjs.org 注册表:

 - "resolved": "https://artifactory.jfrog.private.com:443/api/npm/npm-registry-virtual/aproba/-/aproba-1.2.0.tgz",
 - "resolved": "https://artifactory.jfrog.private.com:443/api/npm/npm-registry-virtual/aproba/-/aproba-1.2.0.tgz?dl=https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
Run Code Online (Sandbox Code Playgroud)

有时该字段直接指向 npmjs.org 存储库:

- "resolved": "https://artifactory.jfrog.private.com:443/api/npm/npm-registry-virtual/acorn/-/acorn-3.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz",
Run Code Online (Sandbox Code Playgroud)

这些变化中的任何一个也可能朝着相反的方向发展。

这真的很烦人,因为这意味着我们不断在 package-lock.json 中进行无意义的更改,这会导致合并冲突并经常阻止 npm ci 正确执行。npm cache clean --force 似乎没有帮助。我知道 npm install 可以自动解决 package-lock.json 合并冲突,但这对 npm ci 没有帮助(因为重点是不在CI 环境中运行 npm install )。而且,无论如何,查看虚拟 npm 注册表如何在内部解析包有什么好处(我怀疑这里正在发生)?

是否有某种配置选项可以防止 JFrog Artifactory 对虚拟 npm 注册表中已解析的包 URL 进行此类更改?或者它可能是 …

artifactory npm package-lock.json

27
推荐指数
1
解决办法
3355
查看次数

如何防止先前部署的工件被覆盖?

我们将Artifactory用于我们公司的Maven存储库.有没有办法设置它(或设置Maven),以便在存在具有相同版本号的预先存在的工件时,无法将工件部署到存储库?

这样做的原因是为了确保有效版本不会被意外覆盖.如果确实需要重新部署工件,我们的开发人员可以使用Artifactory Web界面将其删除.然后他们可以部署新副本.

谢谢!

artifactory maven-3 maven

26
推荐指数
1
解决办法
5499
查看次数

Archiva vs Artifactory

对于MAVEN,Archiva与Artifactory存储库有什么区别?

有人对比图吗?

哪一个更好于这两个,因为我正在寻找免费存储库而不是寻找许可证版本,所以我知道NEXUS是最好的,但不要在此考虑作为讨论点.

archiva artifactory maven

26
推荐指数
1
解决办法
2万
查看次数

Nexus或Artifactory可以存储简单的tar.gz工件吗?

我的云服务器位于世界各地的不同数据中心.每个数据中心都与其他数据中心分开.

我正在寻找一种简单的方法,可以轻松,一致地在每个区域中将工件部署到各个服务器集群(可能运行不同版本的软件,即开发,测试和生产集群).在我看来,工件服务器是我需要的,因为我可以在云服务器上执行安装脚本,从而下载正确的软件工件.

现在,我在运营方面工作.我不关心做构建或管理软件构建依赖性.我只想要一个工件服务器,我可以存储我的所有不同版本的软件包,以便以后访问.踢球者,我有几种不同类型的工件要存储.

  • Shell脚本
  • Python脚本
  • 木偶表现出来
  • Debian文件(通常作为多个debians的tar.gz文件提供)

Nexus或Artifactory可以管理所有这些类型的包,还是我应该朝不同的方向寻找?我不反对将make文件添加到我的shell脚本项目中,这些项目只生成tar.gz文件.我只是不想走下设置工件库的道路,最终,一个小脚本,wget和一个apache服务器可以正常工作.

deployment artifacts nexus artifactory

25
推荐指数
2
解决办法
2万
查看次数