我们有许多Java项目,它们是使用Jenkins构建的CI.这些部署到我们自己的Nexus服务器就好了.问题是,我们需要将这些库提供给第三方,但没有源代码.因此,对于每个项目,在Nexus中我们有:
问题是:在Jenkins/Nexus世界中,这通常是如何处理的?我宁愿在Jenkins中有一个单独的Job,它可以"自动"处理CI构建和发布(artefact部署)过程.目前我<distributionManagement>在"main root pom.xml"中使用了多个配置文件(包含在所有项目中):
[...]
<profiles>
<profile>
<id>default</id>
<distributionManagement>
<repository>
<id>releases</id>
<name>Release</name>
<url>http://path/to/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshot</name>
<url>http://path/to/nexus/content/repositories/snapshots/</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>third-party</id>
<distributionManagement>
<repository>
<id>releases</id>
<name>Release</name>
<url>http://path/to/nexus/content/repositories/third-party/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshot</name>
<url>http://path/to/nexus/content/repositories/third-party-snapshots/</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)
在Maven文档中,似乎无法在同一构建生命周期中使用多个存储库,更不用说我们需要/不需要基于目标存储库的源.
我可以使用Maven"目标和选项"在Jenkins中创建一个Job,clean deploy -P third-party然后使用"默认"数据添加Post-build操作 - "将工件部署到Maven存储库" - 但在这种情况下,仅SNAPSHOTs将通过Jenkins Maven Release Plug-in发布的repo和artefacts 仅进入一个存储库.
任何实用的想法如何在不过度复杂CI作业层次结构的情况下实现这一目标?
提前致谢!
我的用例很简单:我有一个带有一些请求的 Postman Collection,其中之一是:
GET www.example.com/stores?country={{country}}
Run Code Online (Sandbox Code Playgroud)
然后进行简单的测试:
GET www.example.com/stores?country={{country}}
Run Code Online (Sandbox Code Playgroud)
因此,在 Collection Runner 中使用以下 Collection 数据一切都很好:
country,size
UK,15
US,32
Run Code Online (Sandbox Code Playgroud)
然而,当我只是想通过主邮差窗口运行它时,显然请求和测试失败了。我可以将集合变量设置country为SE,但我不知道如何设置size只是pm.iterationData为了尝试我的请求和测试脚本是否适用于另一个“国家” - 而不运行整个集合/迭代。
预先感谢您的所有帮助!
我有这小段代码:
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
public static void main(String[] args) {
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
System.out.println(format.format(new Date()));
}
}
Run Code Online (Sandbox Code Playgroud)
使用Java 8,输出为:
Tue, 16 Jul 2019 13:16:54 AEST
使用Java 11:
Tue., 16 Jul. 2019 13:16:54 AEST
为什么会有区别?我该如何修改代码以使其在两个Java版本中均能正常工作?
我实际上是在发现此问题时使用的是Handlebars,可以将其范围缩小到Java版本-但是知道如何使用Handlebars为相同的格式字符串产生相同的结果会很酷。