跳至主要内容

Maven support in NetBeans 6.7 m2 ...en

NetBeans has released the second milestone product some days ago. There are many articles on PlanetNetBeans(http://www.planetnetbeans.org) which were talking about the newest features NetBeans 6.7 will bring. Maven support is a highlight feature of them. Many peoples have praised the Maven support in NetBeans 6.7. I am a maven fan, but after I tried it, I was disappointed.

Maven support is an incomplete work now. As described on NetBeans wiki, it supports JEE and Java Web project creation now. I found this functionality is only a short-circuit of the normal "Maven Project". In the second step of the wizard, it only provide a extra Java EE version option. In my idea, it must support: target server selection, project relation (parent Maven module and child Maven module) settings and web framework configuration.
For "Web project", ideally, in the project definition panel , it must provide a "Add to existed Enterprise Application" option to add current maven project as a module to the parent module(a enterprise application). And support specifying the target runtime server , it should support adding suitable server which are defined in "Servers" node in "Services" windows , and it is better to support adding embeded server plugin(jetty). Web framework configuration support is a must for web project.
For "Enterprise project", beside server selection and Java EE version options , it should support creating "Web Module"," EJB Module" and "App Client Module" in the same wizard, and let user can modify the default name and location of children modules(war, ejb, ear).
For "EJB project", like web projct without web framework selection.

Another problem is the "Add library" dialog which occurs when you right click the "Library" node in the Project view. The new "add library" dialog maybe merged from the "Add Library" and "Find Dependency" in NetBeans 6.5. But I dislike this feature , I preferred using the query-result style ( like "Find Dependency" in NetBeans 6.5) view. The three fields in "Add library" dialog are implemented the "Code Completation" feature , maybe some body like it. But on my machine , It is too slow. When I input first character, I must took some minutes waiting the code completion context menu, after it displayed , then I could input the second character. Beside this, not everybody can remember the first part of group id , artifact id of every maven artifacts. For example, if you want add "common logging" dependency to your project, it is a apache project , you maybe guess the group id is "org.apache.commons". But you are wrong , it is "commons". In this way , I wasted much time on guessing the group id and at last I had to give up , and turned to use the Maven repository browser to search it. Obviously this feature is no use for me. My suggestion is remove it from NetBeans 6.7, use the simple query-style view instead it. In this approach , it must search the keyword( the word user input in the query field) in group id , artifact id , package name and full class name of all artifacts in the whole maven repository. So the NetBeans GUI maybe looks united, in the "Navigate" menu, all "Go To" dialogs use this simple UI style.

The third small defect I found is the "Files" windows in Maven project , it displays the logic name of some nodes , not the real system directory name.
1 条评论

此博客中的热门博文

JPA 2.1: Attribute Converter

JPA 2.1: Attribute Converter If you are using Hibernate, and want a customized type is supported in your Entity class, you could have to write a custom Hibernate Type. JPA 2.1 brings a new feature named attribute converter, which can help you convert your custom class type to JPA supported type. Create an Entity Reuse thePostentity class as example. @Entity @Table(name="POSTS") public class Post implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="ID") private Long id; @Column(name="TITLE") private String title; @Column(name="BODY") private String body; @Temporal(javax.persistence.TemporalType.DATE) @Column(name="CREATED") private Date created; @Column(name="TAGS") private List<String> tags=new ArrayList<>(); } Create an attribute converter In this example…

Spring Data Mongo: bridge MongoDB and Spring

Spring Data Mongo: bridge MongoDB and SpringMongoDBis one of the most popular NoSQL products, Spring Data Mongo(Maven archetype id is spring-data-mongodb) tries to provides a simple approach to access MongoDB. Configuration Add the following code fragments in your Spring configuration. <!-- Mongo config --> <mongo:db-factory id="mongoDbFactory" host="localhost" port="27017" dbname="conference-db" /> <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg ref="mongoDbFactory" /> </bean> <mongo:repositories base-package="com.hantsylabs.example.spring.mongo" /> Firstly, declare aDbFactorywhich is responsible for connecting to the MongoDB server. Then, register theMongoTemplateobject which envelop the data operations on MongoDB. Lastly addmongo:repositorieswith an essentialbase-packageattribute, Spring will discovery your d…

Auditing with Hibernate Envers

Auditing with Hibernate Envers The approaches provided in JPA lifecyle hook and Spring Data auditing only track the creation and last modification info of an Entity, but all the modification history are not tracked. Hibernate Envers fills the blank table. Since Hibernate 3.5, Envers is part of Hibernate core project. Configuration Configure Hibernate Envers in your project is very simple, just need to addhibernate-enversas project dependency. <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-envers</artifactId> </dependency> Done. No need extra Event listeners configuration as the early version. Basic Usage Hibernate Envers provides a simple@Auditedannotation, you can place it on an Entity class or property of an Entity. @Audited private String description; If@Auditedannotation is placed on a property, this property can be tracked.