English 中文(简体)
非常轻度的Eclipse-Maven一体化——只有依赖性管理?
原标题:Very lightweight Eclipse-Maven integration - dependency management only?

从我的经验来看,Maven在小型/大型应用中往往过于熟练。 但是,减税管理是Maven非常有用的特点,实际上是唯一能够真正有助于上述类型申请的机构。

我很想知道,我是否能够有一个<>极少和轻度。 Eclipse-Maven Integration that provide only Plus Maven Dependencies to Eclipse Project categorypath in the simpliest possible way.

尤其是,我不想:

  • apply to any Maven conventions (including project layout conventons)
  • install and use any specific Eclipse plugins (Eclipse shouldn t know at all that it is "Maven project" and treat it in any special way)
  • depend on/be bound to Maven in any other way than using it as lightweight jars/libraries downloader

My first (and only) idea is to use Eclipse Maven plugin from command line to manage project classpath. But by default this plugin does more than it (sets up default maven project layout, manage builders). Can I limit this plugin to only do what I want?

我能否达到我以任何其他方式描述的目标?

最佳回答

我发现,解决办法非常适合我所述的需求/用途:

1. 导言 我在Eclipse项目根基中创建了极小的om子:

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sobczyk.piotr</groupId>
    <artifactId>mvn-eclipse-test</artifactId>
    <version>1.0.0</version>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <outputDirectory>bin</outputDirectory>
    </build>

    <dependencies>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>
    </dependencies>
</project>

该档案由三部分组成:

  • Required Maven stuff, ie. modelVersion and GAV
  • build section where Maven default source and output directories and overriden to mimic Eclipse environment (it s the answer to the part of question on limiting maven-eclipse-plugin behaviour, some other eclipse:eclipse goal options like buildcommands may be useful in some more complex cases)
  • dependencies section listing dependencies that I need to have on project classpath

2. 结 论 从指挥线一处援引以下指挥:

mvn eclipse:configure-workspace -Declipse.workspace=C:/myworkspace
cd C:/myworkspace/myproject
mvn eclipse:eclipse

3. 。 我每次都想更新Maven案卷I中的Eclipse项目班次,可以做两件事之一:

  • invoke last two lines from command line
  • bind mvn eclipse:eclipse to Eclipse external tool configuration and invoke it with single click
问题回答

索里,没有。 你可以在这里看到:

rel=“nofollow” http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html

gin子的配置使得能够增加一些附加物、面罩等,但你可以绕过违约物品。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签