我正在尝试在单个Jenkins作业中构建多个Maven配置文件.每个配置文件修改一些代码,然后通过执行创建一个罐子mvn -Pdev install
,然后mvn -Pprod install
在命令行中(根据使用Maven mvn -Pdev,prod install
应该工作,但它不工作对我来说).以下是我项目中的两个配置文件pom.xml
:
<profiles>
<!-- prod profile -->
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>src/main/java/com/IQzone/android/configuration/AbstractHoldingRefreshable.java</file>
<replacements>
<replacement>
<token>TrUe</token>
<value>TOAST_SWITCH</value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>prod</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- dev profile -->
<profile>
<id>dev</id>
<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>replace</goal> …
Run Code Online (Sandbox Code Playgroud) 在我们的项目中,我们正在从ant脚本迁移到gradle构建.
我们将使用artifactory作为我们公司的回购经理来存储工件.
我在artifactory中看到了一些存储库内容,包括libs-snapshot-local
作为远程存储库和libs-snapshot
虚拟存储库.与发布回购libs-release-local
和libs-release
.
你们中的任何一个人都可以解释它们之间有什么区别吗?我可以将工件部署到它们两者吗?
刚刚为NPM和Bower设置了Artifactory,它非常容易使用.您可以只更改存储库URL和一切正常工作.
看看如何让Artifactory与github vcs一起工作的文档看起来过于复杂.我想知道是否有人有办法设置git与Artifactory一起工作?
我发现的文档只使用curl,这不允许我将来使用git.
如果没有人写任何钩子,将Artifactory所需的语法转换为git可以传递和使用的东西.不想失去使用基本git clone,git pull功能的能力.
我将Artifactory设置为Docker存储库.我按照文档,我能够成功从我的虚拟Docker仓库中提取图像.
但是,当我尝试将映像推送到本地存储库时,它会因501 Not Implemented错误而失败.
这是我的设置:
Nginx是反向代理:
artifactory.somedomain.com:8085 -> http://localhost:8081/artifactory/api/docker/docker-local/v2
artifactory.somedomain.com:8086 -> http://localhost:8081/artifactory/api/docker/docker/v2
Run Code Online (Sandbox Code Playgroud)
命令运行:
docker pull artifactory.somedomain.com:8086/busybox:latest
docker tag artifactory.somedomain.com:8086/busybox artifactory.somedomain.com:8085/busybox
docker push artifactory.somedomain.com:8085/busybox
Run Code Online (Sandbox Code Playgroud)
结果是:
The push refers to a repository [artifactory.somedomain.com:8085/busybox] (len: 1)
2c5ac3f849df: Buffering to Disk
Received unexpected HTTP status: 501 Not Implemented
Run Code Online (Sandbox Code Playgroud)
什么想法可能是错的?谢谢!
nginx.conf (前两个规则一般处理重定向http,后两个规则处理Docker存储库的代理)
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events …
Run Code Online (Sandbox Code Playgroud) 我们正在使用Artifactory Version 4.7.0.我已经为Artifactory配置了LDAP,我能够成功登录.当我尝试使用加密密码来部署工件时,它无法正常工作.在Artifacts选项卡中,我点击"Set Me Up"并在输入我的凭据后生成Maven设置.然后我下载了settings.xml文件,其中包含以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
<id>central</id>
</server>
<server>
<username>${security.getCurrentUsername()}</username>
<password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://artifactory:9090/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://artifactory:9090/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://artifactory:9090/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://artifactory:9090/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
Run Code Online (Sandbox Code Playgroud)
然后我转到我的个人资料,输入密码并复制加密密码,如下所示:
我在settings.xml中复制了这个密码,如下所示: …
是否可以全局(或至少每个名称空间)配置kubernetes,使其在连接到私有存储库时始终使用映像拉密钥?有两种用例:
我知道可以在服务帐户的基础上执行此操作,但是如果不编写控制器将其添加到创建的每个新服务帐户中,就会有些混乱。
有没有办法全局设置此值,因此如果kube尝试从注册表X拉出它使用秘密Y?
谢谢
我们有一个内部的神器库.目前所有快照都将在那里部署.我们还希望拥有一个带有Web界面的不同服务器,并希望将创建的工件复制到其中.
对于我们的构建,我们使用Hudson,但是后构建操作"将构件部署到Maven存储库"与scp一起不起作用.所以有一个问题是以其他优雅的方式做到这一点.为什么maven不能拥有多个分发存储库?有任何想法吗?
最好的事情是,如果artifactory在每次新部署后都支持(自动!)增量导出到标准maven存储库.
背景.我的组织使用Maven,Bamboo和Artifactory来支持持续的集成过程.我们依靠Maven的SNAPSHOT限定符来帮助管理Artifactory中的存储(转出旧的SNAPSHOT构建),并帮助保持跨团队集成的最新状态(Maven在每个构建时自动检查SNAPSHOT依赖项的更新).
问题.我们面临的挑战之一是在继续使用SNAPSHOT的同时正确地推动从环境到环境的构建.假设测试人员将1.8.2-SNAPSHOT版本部署到功能测试环境中,并且在Subversion中的版本为1400.我们也说它通过了功能测试.当测试人员决定从Artifactory将1.8.2-SNAPSHOT拉入性能测试环境时,开发人员可能已经对Subversion进行了更改,因此Artifactory中的实际二进制文件处于不同的转速.在使用SNAPSHOT版本时,我们如何确保转速不会从我们下面改变?
约束.我们显然不希望在不知不觉中部署不同的构建.我们也不想从源代码重建,因为我们想要测试我们在功能测试中测试的性能测试中的确切二进制文件.
我们考虑过的方法.我们想要用第四个组件标记版本,比如1.8.2.1400,其中第四个组件是Subversion rev.(作为一个附带问题,是否有一个Maven插件或其他自动执行此操作的东西?)但是如果我们这样做,那么基本上我们失去了SNAPSHOT功能,因为Maven和Artifactory认为这些是不同的版本.
我们正在使用Scrum,因此我们很早就部署到测试环境(比如第二天左右).我不认为在开发周期的早期删除SNAPSHOT限定符是有意义的,因为我们再次失去了SNAPSHOT的好处.
很高兴知道其他组织如何解决这个问题.
我正试图在公司防火墙后面运行SBT.另一个团队配置了Artifactory代理.这个代理可以正常启用匿名访问,但是当我们让它需要密码时,认为开始出错了.
当我在工作站上运行SBT时,出现以下错误:
[error] Unable to find credentials for [Artifactory Realm @ coderepo.xxx.amrs.bigco.com]
Run Code Online (Sandbox Code Playgroud)
结果是我无法引导sbt:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-library;2.10.6: not found
[warn] :: org.scala-sbt#sbt;0.13.12: not found
[warn] :: org.scala-lang#scala-compiler;2.10.6: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
Run Code Online (Sandbox Code Playgroud)
我已经尝试在./ .sbt和〜/ .ivy2中放置一个.credentials文件:我一直在测试以下内容的变体,所有这些都不起作用:
realm=Artifactory Realm @ coderepo.xxx.amrs.bigco.com
host=coderepo.xxx.amrs.bigco.com
user=<username>
password=<pwd>
Run Code Online (Sandbox Code Playgroud)
我猜这个错误意味着它无法找到与领域匹配的凭据定义,所以我在两个位置尝试了第一行的多个版本:
realm=Artifactory Realm
realm=[Artifactory Realm @ coderepo.xxx.amrs.bigco.com]
realm=coderepo.xxx.amrs.bigco.com
Run Code Online (Sandbox Code Playgroud)
这些似乎都没有任何影响.
那么,允许SBT使用用户名和密码对受密码保护的Artifactory存储库进行身份验证的正确方法是什么?
UPDATE0:根据常春藤文档,最可能的领域名称只是"Artifactory Realm".根据SBT文档,凭证文件的正确默认位置应为%USERPROFILE%/.sbt/.credentials(是的,我使用的是Windows).即使在删除.ivy2目录中的.credentials文件后,它仍然无效.
更新1:相关但实际上并没有帮助:
UPDATE2:我开始怀疑这是sbt中的一个错误 - 我在这里添加了一个问题:https://github.com/sbt/sbt/issues/2817
我正在尝试创建一个自定义Artifactory存储库来解决我的gradle项目中的依赖项,但我在gradle和maven repo之间感到困惑:我应该选择哪个存储库密钥?gradle存储库和maven存储库之间的真正区别是什么?