IvyIdea 插件 - 不解决依赖关系 [英] IvyIdea plugin - does not resolve dependencies

查看:116
本文介绍了IvyIdea 插件 - 不解决依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 IntelliJ,添加了 IvyIdea 插件,现在尝试使用 IvyIdea 解决项目(Ant 构建)的依赖项,但收到有关未解决的依赖项"的错误.我已经下载并配置了 Ivy 和 Ant.

I am using IntelliJ, added IvyIdea plugin and now trying to resolve dependencies for a project (Ant build) using IvyIdea but getting error about "UNRESOLVED DEPENDENCIES". I have downloaded and configured Ivy and Ant.

我可以使用 Ant 命令行解析和构建项目,但不能通过 IDE.我可以看到 ~.ivy2\cache 文件夹已经解决了它抱怨的所有依赖项.

I can resolve and build the project using Ant command line but not via IDE. I can see the ~.ivy2\cache folder has got all the dependencies resolved which it is complaining about.

我已经为所有模块配置了Facets"以映射到正确的 Ivy 设置并构建属性文件.有谁知道我还有什么可以尝试的吗?

I have configured "Facets" for all modules to map to the correct Ivy settings and build properties files. Does anyone know if there is anything else I can try?

我现在在日志中发现的一件事,

One thing I found now in the logs,

loadData of pentaho-kettle#kettle-core;7.1-SNAPSHOT of rootConf=default
    using default to resolve pentaho-kettle#kettle-core;7.1-SNAPSHOT
default: Checking cache for: dependency: pentaho-kettle#kettle-core;7.1-SNAPSHOT {default-ext=[default]}
don't use cache for pentaho-kettle#kettle-core;7.1-SNAPSHOT: changing=true
don't use cache for pentaho-kettle#kettle-core;7.1-SNAPSHOT: changing=true
    local (useCacheOnly) : no ivy file found for pentaho-kettle#kettle-core;7.1-SNAPSHOT
main: Checking cache for: dependency: pentaho-kettle#kettle-core;7.1-SNAPSHOT {default-ext=[default]}
don't use cache for pentaho-kettle#kettle-core;7.1-SNAPSHOT: changing=true
don't use cache for pentaho-kettle#kettle-core;7.1-SNAPSHOT: changing=true
    shared (useCacheOnly) : no ivy file found for pentaho-kettle#kettle-core;7.1-SNAPSHOT
don't use cache for pentaho-kettle#kettle-core;7.1-SNAPSHOT: changing=true
    public (useCacheOnly) : no ivy file found for pentaho-kettle#kettle-core;7.1-SNAPSHOT
WARN:   module not found: pentaho-kettle#kettle-core;7.1-SNAPSHOT
WARN: ==== local: tried
WARN: ==== shared: tried
WARN: ==== public: tried

我已经确保我使用了正确的 Ivy 设置和构建属性,但它仍然出现相同的错误.

I have made sure I am using correct Ivy settings and build properties but still it gives the same errors.

推荐答案

我还尝试使用 IntelliJ 与 Pentaho 一起工作.这是一项相当艰巨的工作,因为很多代码是使用 Apache Ivy 和 Ant 设置的,其余的都是使用 Maven 完成的.

I also tried to work with Pentaho using IntelliJ. It is quite a job, because a lot of code is set up using Apache Ivy and Ant, and the rest is done with Maven.

对我有用的是以下..

  • 确保从命令行正常构建工作.

  • Make sure the normal build works from the command line.

在 IntelliJ 中安装最新的 IvyIdea 插件

Install the latest IvyIdea plugin in IntelliJ

现在打开 IntelliJ,只需打开 pentaho-kettle 目录,无需导入任何内容.

Now open IntelliJ, and just open the pentaho-kettle directory without importing anything.

从现有源中选择文件 -> 新建 -> 模块,然后选择程序集"目录.

Select File -> New -> Module from existing sources, then select the "assembly" directory.

让它导入源,但取消选择它找到的任何库.它还应该自动找到 ivy.xml 并添加 IvyIdea facet.

Let it import the sources, but deselect any libraries it finds. It should also automatically find the ivy.xml and add the IvyIdea facet.

导入后在项目浏览器中点击assembly",然后按F4进入模块设置.

After the import click on "assembly" in the Project browser, then press F4 to go to the module settings.

点击模块的Sources"选项卡,检查是否有名为res"、packages-res"的目录或任何其他表示资源的非标准目录——除了 build-res(忽略那些).单击这些目录,然后单击树上方的标记为 - 资源".

Click the "Sources" tab for the module and check if there is a directory called "res", "packages-res" or anything else nonstandard that means resources - EXCEPT build-res (ignore those). Click on those directories, then click "Mark as - resource" above the tree.

单击模块的IvyIdea"构面,并配置以下内容:

Click the "IvyIdea" facet for the module, and configure the following:

  • 选择使用模块特定设置"(选中).然后选择Use your own",从assembly"目录中选择ivysettings.xml文件.

  • select "Use module specific settings" (make it checked). Then select "Use your own", and select the ivysettings.xml file from the "assembly" directory.

单击属性"选项卡,然后单击添加文件",然后从程序集目录中选择 build.properties 文件.

Click the "properties" tab, then "Add file", and select the build.properties file from the assembly directory.

对其他主​​要模块重复此过程,例如核心和引擎以及您可以找到 ivy.xml 文件的所有其他模块.这是很多工作,因为有很多模块.您可以使用以下命令(linux)查找所有模块:

Repeat this process for the other main modules, like core and engine and everything else where you can find a ivy.xml file. This is a lot of work, as there are many modules. You can use the following command (linux) to find all modules:

find . -name 'ivy.xml'

  • 完成后,通过在项目资源管理器中单击 pentaho-kettle(主目录),让 IvyIdea 解决所有依赖项,然后右键单击 -> IvyIdea -> 解决所有依赖项.确保准备好大量咖啡和午餐,因为这需要很长时间.

  • Once done let IvyIdea resolve all dependencies by clicking pentaho-kettle (the main directory) in the project explorer, then right-click -> IvyIdea -> resolve all dependencies. Make sure you have lots of coffee and lunch ready because it will take forever.

    在插件下找到pom.xml"文件.在 IntelliJ 的右侧打开Maven Projects"视图(或使用 View -> Tool Windows -> Maven projects).

    Under plugins find the "pom.xml" file there. On the right side of IntelliJ open the "Maven Projects" view (or use View -> Tool Windows -> Maven projects).

    在该 Maven 视图中,单击绿色 + 以添加 pom,然后导航到 plugins/pom.xml.这让 IntelliJ 导入其余的插件.这又需要一段时间.

    In that Maven view, click the green + to add a pom, and navigate to plugins/pom.xml. This lets IntelliJ import the rest of the plugins. This again takes a while.

    现在,单击 Project Explorer 中的 UI 模块,然后按 F4.单击依赖项"选项卡,然后单击右侧的绿色+"并选择模块依赖项".

    Now, click on the UI module in the Project Explorer, then press F4. Click the "dependencies" tab, then the green "+" on the right and select "Module dependency".

    在随后的列表中:选择所有内容,然后按确定.这使得 ui 模块有一个包含插件的类路径,这样勺子就会在启动时找到这些东西.

    In the list that follows: select everything, then press ok. This makes the ui module have a classpath that includes the plugins, so that spoon will find the thingies when starting.

    在此之后 IntelliJ 应该能够构建添加的模块:按 ctrl+f9 进行检查.

    After this IntelliJ should be able to build the modules added: press ctrl+f9 to check.

    让这个东西运行起来又是一大乐趣.我正在运行 Linux,因此此处的说明适用于此.其他操作系统或 Windows 上的 YMMV.

    To get this thing to run is yet another bag of fun. I am running Linux, so the instructions here apply to that. YMMV on other operating systems or Windows.

    • 在项目资源管理器中,找到 UI 项目中的Spoon"类(或按 CTRL+N 然后按 Spoon).

    • In the project explorer, find the "Spoon" class in the UI project (or press CTRL+N then Spoon).

    找到 main 方法并按下它前面空白处的绿色按钮.这将尝试运行 main,并且会死得很惨——但是 IntelliJ 现在已经做了一个运行配置 ;)

    Find the main method and press the green button in the margin before it. This will try to run main, and will die horribly - but IntelliJ now has made a run configuration ;)

    打开运行配置(运行 -> 编辑配置).

    Open the run configuration (Run -> Edit Configurations).

    在VM 选项"下添加以下内容(单击右侧的小框以获取大输入字段):

    Under "VM Options" add the following (click the little box to the right to get a big input field):

    -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2
    -Djava.library.path=./../libswt/linux/x86_64/
    -DKETTLE_HOME=
    -DKETTLE_REPOSITORY=
    -DKETTLE_USER=
    -DKETTLE_PASSWORD=
    -DKETTLE_PLUGIN_PACKAGES=
    -DKETTLE_LOG_SIZE_LIMIT=
    -DKETTLE_JNDI_ROOT=
    -DKETTLE_PLUGIN_CLASSES=org.pentaho.di.trans.steps.gpload.GPLoadMeta,org.pentaho.di.core.database.PALODatabaseMeta,org.pentaho.di.trans.steps.palo.cellinput.PaloCellInputMeta,org.pentaho.di.trans.steps.palo.celloutput.PaloCellOutputMeta,org.pentaho.di.trans.steps.palo.diminput.PaloDimInputMeta,org.pentaho.di.trans.steps.palo.dimoutput.PaloDimOutputMeta,org.pentaho.di.trans.steps.hl7input.HL7InputMeta,org.pentaho.di.job.entries.hl7mllpack.HL7MLLPAcknowledge,org.pentaho.di.job.entries.hl7mllpin.HL7MLLPInput,org.pentaho.di.starmodeler.StarModelerSpoonPlugin,org.pentaho.di.core.market.Market,org.pentaho.di.job.entries.palo.JobEntryCubeCreate.PaloCubeCreate,org.pentaho.di.job.entries.palo.JobEntryCubeDelete.PaloCubeDelete,org.pentaho.di.core.database.OpenERPDatabaseMeta,org.pentaho.di.trans.steps.openerp.objectinput.OpenERPObjectInputMeta,org.pentaho.di.trans.steps.openerp.objectoutput.OpenERPObjectOutputMeta,org.pentaho.di.trans.steps.openerp.objectdelete.OpenERPObjectDeleteMeta
    

  • 这些参数是从spoon.sh 中窃取的,它通常是启动Spoon 的脚本.如果仍有问题,您可能需要检查该文件.

  • These parameters were stolen from spoon.sh, the script that usually starts Spoon. You might want to check that file if you still have trouble.

    设置工作目录为pentaho-kettle/assembly/package-res

    Set the working directory to pentaho-kettle/assembly/package-res

    使用环境变量"后面的按钮添加以下环境变量:

    Add the following environment variables using the button after "Environment variables:

    这应该可以运行 Spoon.您可能会在控制台中收到相当多的消息,而 Spoon 可能需要超过一分钟的时间才能启动(在我相当快的机器上),所以请耐心等待 ;)

    This should make it possible to run Spoon. You might get quite some messages in the console, and Spoon can take more than a minute to start (on my quite fast machine), so be patient ;)

    祝你好运;)

    这篇关于IvyIdea 插件 - 不解决依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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