hybris的行家不会下载传递依赖 [英] hybris's maven doesn't download transitive dependencies

查看:132
本文介绍了hybris的行家不会下载传递依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Hybris扩展的external-dependencies.xml中设置我的依赖项.问题在于它只是加载我在其中指定的库,而没有加载运行时需要使用的依赖项.

I am trying to set my dependencies in the external-dependencies.xml in Hybris extension. The problem is it just load the libraries I specified in there and doesn't load the dependencies that the libraries need to work with at run-time.

例如,Aixs2-kernel加载Axiom-api,impl和adb等.而且在普通的Maven项目中,我不需要一个一个地指定它们.

For example Aixs2-kernel loads Axiom-api and impl and adb and so on. And in a normal maven project I don't need to specify each of them one by one.

有什么办法让Hybris理解去取走其余的吗?

Is there any way to make Hybris understand to fetch the rest of them?

推荐答案

SAP Hybris 6.4 +

是的,您可以通过覆盖扩展名project.properties文件中的maven.download.options参数来实现.它的默认值等于:

Yes, you can do this in by overwriting the maven.download.options parameter in an extension project.properties file. It's default value is equal to:

-DoverWriteReleases=true -DoverWriteSnapshots=true -DoverWriteIfNewer=true -DexcludeTransitive=true

如果将扩展名添加到扩展名project.properties,则该行:

If you add to your extension project.properties the line:

maven.download.options=-DoverWriteReleases=true -DoverWriteSnapshots=true -DoverWriteIfNewer=true

SAP Hybris平台将下载所有依赖项(也可传递).当然,此更改仅适用于您的扩展名(请不要更改位于核心扩展名中的project.properties文件的内容).

SAP Hybris platform will download all dependencies (also transitive). Of course this change will work only for your extension (please don't change content of the project.properties file located in core extensions).

SAP Hybris 6.3及更高版本

传递依赖项的排除是硬编码在hybris/bin/platform/resources/ant/mavenTasks.xml文件中(宏updateLibFolder).唯一可能的解决方案是在SAP Hybris平台中打补丁.您可以更改此代码:

Exclusion of the transitive dependencies is hardcoded in the hybris/bin/platform/resources/ant/mavenTasks.xml file (macro updateLibFolder). The only possible solution is to do a patch in SAP Hybris platform. You can change this code:

<artifact:mvn pom="@{dependencyFile}" fork="true" failonerror="true" mavenVersion="3.2.5">
    <arg value="dependency:copy-dependencies" />
    <arg value="-DoutputDirectory=@{libfolder}" />
    <arg value="-DoverWriteReleases=true" />
    <arg value="-DoverWriteSnapshots=true" />
    <arg value="-DoverWriteIfNewer=true" />
    <arg value="-DexcludeTransitive=true" />
</artifact:mvn>

收件人:

<artifact:mvn pom="@{dependencyFile}" fork="true" failonerror="true" mavenVersion="3.2.5">
    <arg line="dependency:copy-dependencies -DoutputDirectory=@{libfolder} ${maven.download.options}" />
    <jvmarg line="${env.MAVEN_OPTS} ${env.JAVA_OPTS}" />
</artifact:mvn>

接下来定义一个属性

maven.download.options=-DoverWriteReleases=true -DoverWriteSnapshots=true -DoverWriteIfNewer=true

中的

,最后从6.4+的解决方案开始执行步骤.

in the hybris/bin/platform/project.properties and finally do steps from the solution for 6.4+.

警告:SAP Hybris平台提供了许多库,因此可能某些传递依赖项已经可用.这就是为什么禁用传递依赖项下载的原因.我认为最好手动指定它们,而不要下载所有内容(这样可以避免版本差异带来的麻烦).

Warning: SAP Hybris platform provides a lot of libraries, so probably some of your transitive dependencies are already available. That is the reason, why downloading of the transitive dependencies are disabled. I think it is a good idea to specify them manually instead of downloading everything (you will avoid problems with the differences of the version).

这篇关于hybris的行家不会下载传递依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆