开发者

automatic import of existing maven dependencies

I have maven dependency with available source code. Is it possible to import it as maven project in eclipse automatically?

I can manually create new maven project in eclipse, unpack source code in its source directory and pom file.

Are there any plugin or oth开发者_运维问答er tool that does such work?


Use the Maven Eclipse plugin and tell it to download sources and javadocs for you:

<project>
  [...]
  <build>
    [...]
    <plugins>
      [...]
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>true</downloadJavadocs>
        </configuration>
      </plugin>
      [...]
    </plugins>
    [...]
  </build>
  [...]
</project>


You could also look at m2eclipse an eclipse plugin for maven, which automagically recognizes maven projects.


For several years Eclipse and IDEA go with Maven plugin.

For Eclipse, right-click and Maven -> Download sources. Or Ctrl+click into and IDE will download in few seconds.

This way you don't force download for all PCs as with maven-eclipse-plugin.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜