且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

IvyIdea插件-无法解决依赖关系

更新时间:2023-09-18 08:41:28

我也尝试使用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.

对我有用的是以下内容.

What worked for me is the following..

  • 确保从命令行可以正常进行构建.

  • 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构面.

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

导入后,在项目浏览器中单击程序集",然后按F4转到模块设置.

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

单击模块的源"选项卡,然后检查是否存在一个名为"res","packages-res"的目录或任何其他非标准的目录,即资源-EXCEPT 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:

  • 选择使用模块特定设置"(选中).然后选择使用您自己的",然后从程序集"目录中选择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'

  • 完成后,让IvyIdea通过在项目资源管理器中单击pentaho-kettle(主目录)来解决所有依赖关系,然后右键单击-> 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项目"视图(或使用View-> Tool Windows-> Maven项目).

    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".

    在下面的列表中:选择所有内容,然后按OK.这使ui模块具有一个包含插件的类路径,以便Spoon在启动时会找到东西.

    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).

    找到主要方法,然后按一下其空白处的绿色按钮.这将尝试在主目录下运行,并且将致命地死掉-但是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 Options"下,添加以下内容(单击右侧的小框以获取较大的输入字段):

    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

    使用环境变量:

    这应该可以运行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 ;)

    祝你好运;)