Using an IDE
to
develop today is necessary but any IDE worth his salt can be enhanced with
additional features. NetBeans, IntelliJ IDEA and Eclipse have this kind of
mechanism. In this article, I will mention the plugins I couldn’t develop
without in Eclipse and for each one advocate for it.
m2eclipse
Maven is my build tool of choice since about 2 years. It adds some very nice
features comparing to Ant, mainly the dependencies management, inheritance and
variable filtering. Configuring the POM
is kind of hard once you’ve reached a
fairly high number of lines. The Sonatype m2eclipse plugin
(formerly hosted by Codehaus) gives you a tabs-oriented view of every aspect of
the POM:
- An Overview tab neatly grouped into : Artifact, Parent, Properties, Modules,
Project, Organization, SCM, Issue Management and Continuous Integration,
- A Dependencies tab for managing (guess what) dependencies and dependencies
management. For each of the former, you can even exclude dependent artifacts.
This tab is mostly initialized at the start of the project, since its
informations shouldn’t change during the lifecycle,
- A Repositories tab to deal with repositories, plugin repositories,
distribution, site and relocation (an often underused feature that enable you to
change an artifact location without breaking builds a.k.a a level of
indirection),
- A Build tab for customizing Maven default folders (a usually very bad idea),
- A Plugins tab to configure and/or execute Maven plugins. This is one of the
most important tab since it’s here you will configure
maven-compiler-plugin
to use Java 6, or such,
- A Report tab to manage the
<report>
part,
- A Profiles tab to cope with profiles,
- A Team tab to fill out team-oriented data such as developers and
contributors information,
- The most useful and important tab (according to me) graphically displays the
dependency tree. Even better, each scope is represented in a different way and
you can filter out unwanted scope.
- Last but not least, the last tab enables you to directly edit the underlying
XML.
Moreover, m2eclipse adds a new Maven build Run configuration that is
equivalent for the command line:
With
this, you can easily configure the -X
option (Debug Output) or the
-Dmaven.test.skip
option (Skip Tests).
More importantly, you can set up the plugin to resolve dependencies from
within the workspace during Eclipse builds; that is, instead of using your
repository classpath, Eclipse will use the project’s classpath (provided it is
in the desired version). It prevents the need to build an artifact each time it
is modified because another won’t compile after the change. It merely duplicates
the legacy Eclipse dependency management.
I advise not to use the Resolve Workspace artifacts in the previous Run
configuration because it will use this default behaviour. In Maven build, I want
to distance myself from the IDE, using only the tool’s features.
TestNG plugin
For those not knowing TestNG
, it is very similar to JUnit4. It was the first to
bring Java 5 annotations (even before JUnit) so I adopted the tool. Now as to
why I keep it even though JUnit4 uses annotations: it has one important feature
JUnit has not. You can make a test method dependent on another, so as to develop
test scenarios. I know this is not pure unit testing anymore; still I like using
some scenarios in my testing packages in order to test build breaks as early as
possible.
FYI
, Maven knows about TestNG
and runs TestNG tests as readily as JUnit ones.
The TestNG plugin
for Eclipse
does as the integrated JUnit plugin does, whether regarding
configuration or run or even test results.
Emma
When developing, and if one uses tests, one should know about one’s test
coverage over code. I used to use Cobertura
Maven plugin
: I configured in the POM and, every once in a while, I ran a
simple mvn cobertura:cobertura
. Unfortunately, it is not very
convenient to do so. I searched for an Eclipse plugin to have the same feature;
alas, there’s none. However, I found the EclEmma Eclipse plugin
that brings the same functionality. It
uses Emma
(an
OpenSource code coverage tool) under the hood and, though I searched thoroughly,
Emma has no Maven 2 plugin. Since I value equally IDE code coverage during
development and Maven code coverage during nightly builds (on a Continuous
Integration infrastrcuture), so you’re basically stuck with 2 different
products. So?
ElcEmma provides a 4th run button (in addition to Run, Debug and External
Tools) that launches the desired run configuration (JUnit, TestNG or what have
you) in enhanced mode, the latter providing the code coverage feature. In the
above screenshot, you can see line 20 was not run during the test.
Even better, the plugin provides a aggregation view for code coverage
percentage. This view can be decomposed on the project, source path, package and
class levels.
Spring IDE
Spring does not need to be introduced. Whether it will be outed by JEE 5
dependency injection annotations remains to be seen. Plenty of projects still
use Spring and that’s a fact. Still, XML configuration is very ankward in Spring
in a number of cases:
- referencing a qualified class name. It is not neither easy nor productive to
type it; the same is true for properties
- understanding complex or big configurations files
- referencing a Spring bean in a hundred or more lines of file
- refactoring a class name or a property name without breaking the
configurations files
- being informed of whether a class is a Spring bean in a project and if so,
where it is used
Luckily, Spring IDE provides features that make such tasks easy as a
breeze:
- auto-completion on XML configuration files
- graphic view of such files
- an internal index so that refactoring is takes into account the XML files
(though I suspect there is some bugs hidden somewhere for I regularly have
errors)
- a enhanced Project Explorer view to display where a bean is used
This entire package guarantees a much better productivity when using XML
configuration in Spring than plain old XML editor. Of course, you can still use
Annotation configuration, though I’m reluctant to do so (more in a latter
post).
I conclusion, these 4 integration plugins mean I feel really more comfortable
using their underlying tools. If I were in an environment where I couldn’t
update my Eclipse however I choose, I would definitely think about using these
tools at all (except Maven), or use Annotations configuration for Spring. You
can have exceptional products or frameworks, they have to integrate seamlessly
into your IDE(s) to really add value: think about the fate of EJB v2!
相关推荐
hadoop 2.2 eclipse plugins 插件 拷贝至plugins即可 留给自己的,当做备份用
【Hibernate Tools for Eclipse Plugins】是Eclipse集成开发环境中用于支持Hibernate框架的一组插件,它提供了许多方便开发者的功能,如代码生成、配置文件编辑、逆向工程等。这些工具极大地简化了Hibernate应用的...
Hibernate Tools is a toolset for Hibernate implemented as an integrated suite of Eclipse plugins, together with a unified Ant task for integration into the build cycle. Hibernate Tools is a core ...
axis2-eclipse-codegen-wizard-1.4.zip axis2-eclipse-service-archiver-wizard-1.4.zip 官方封了中国IP,不好下到,解压就看到了!
"eclipse-plugins"这个资源指的是一个特定的Eclipse配置,其中包含了针对特定功能或框架的插件集合。在这个案例中,Eclipse Mars 4.5.1 版本已经预装了Spring Boot和Activiti等插件,这些都是开发人员在Java应用开发...
Eclipse: Building Commercial-Quality Plug-ins was an invaluable training aid for all of our team members. In fact, training our team without the use of this book as a base would have been virtually ...
hadoop 1.0.3 eclipse plugins 插件
标题“Java Tools Eclipse Plugins”揭示了我们关注的焦点是Java编程环境中的Eclipse插件,这些插件是为了增强Eclipse IDE的功能,以更好地支持开发、调试和测试Java应用程序。Eclipse是一个开源的集成开发环境(IDE...
hadoop 2.0.0 eclipse plugins 插件
eclipse 插件,用于properties文件编辑,支持eclipse 3.5,可离线使用 jp.gr.java_conf.ussiy.app.propedit_5.3.5,通过eclipse更新源获取。
Eclipse Plugins 3rd part-1
Eclipse的插件允许开发者根据自己的需求定制工作环境,增加对不同语言、框架和技术的支持。 首先,我们来看"Ant使用指南.pdf"。Ant是Apache软件基金会的一个项目,是一个基于Java的构建工具,常用于Java应用的编译...
Eclipse是一款著名的开源集成开发环境(IDE),广泛用于Java、C++、Python等多种编程语言的开发。Eclipse的强大力量在于其可扩展性,这主要归功于丰富的插件系统。下面将详细介绍标题和描述中提到的三个Eclipse插件...
CDT+DLTK Eclipse Plugins, 直接拷贝,无需安装。
Eclipse 是一个流行的开源集成开发环境(IDE),广泛用于Java及其他编程语言的开发。ClearCase for Eclipse 插件是 IBM 提供的,旨在让开发者能够在 Eclipse 平台上无缝地使用 ClearCase 的功能。通过这个插件,...
不喜欢使用myEclipse的朋友可以尝试下 最近在项目中使用Hibernate,由于需要...附件中为本人配置的eclipse HQL Plugins截图 希望对大家有所帮助。 工具很好用,可以识别出HQL文的语法正确,并且解析为标准SQL语句。
Eclipse是一款流行的开源集成开发环境(IDE),它支持多种编程语言。为了在Eclipse中集成SVN,开发者通常会使用特定的插件,使得在Eclipse内部就能进行版本控制操作,如提交、更新、查看差异等。这种集成提高了开发...