Maven POM Chains

10/02/2008

POM setting in Maven can be inherited from one parent project to many children projects. But all elements in the POM inherit chain should in Maven Repository. Only with this condition can success run the setting for grand child project with “maven test”.


@Override Compile-time Error in Java 5

10/01/2008

The Annotation is new feature since Java 5. But when you use the @Override for a method, it implements from interface, you will get the Error message like “method does not override a method from its superclas”. By Java 6 not.

In Java Language Specification, you can find answer.


Security Warning Message in IE6 and empty iframe

07/17/2008

Last two days we have a problem wiht Security Information Window.

Security Information from IE6

Security Information from IE6

This window will be showed by each page loading. Why? After long searching we finded the answer. There is a empty iframe. It will be created by lightbox2.js in lightbox module for Drupal CMS. But for the most page, there is nothing in this iframe and it is also nonvisible.

How to fix this problem? You can find a solution on MSDN page. PRB: Security Warning Message Occurs When You Browse to a Page That Contains an IFRAME Through SSL

But for our problem, we find out another solution. We comment the code for iframe creating in lightbox2.js. Then, everything is fine! But when will be the content in iframe created? We do not have the answer.


Eclipse IDE show heap status

06/20/2008

It cost me fast one hour to find out, where can I configure the “show heap status” in Eclipse IDE. First I thought, it is a Plugin for Eclipse. No, it’s not!

You can find it as standard configuration in Menu “Window -> Preferences -> General”. Check on the configuration “Show heap status”, then click “OK”, and you can find the heap status monitor in status-bar right bottom in your IDE. Just like the following picture.

image


Maven POM 项目对象模型

05/28/2008

一个项目对象模型或者POM是Maven工作的基本单元。它是一份XML文档,其中包含了项目的相关信息和Maven构建项目的配置细节。它包含了整个项目的默认值,如:构件的目标文件夹为target;源代码文件夹src/main/java;测试代码文件夹src/main/test;等等。

POM是从Maven第一个版本中的project.xml转变为Maven 2中的pom.xml。

Maven主要目标是标准化构建过程,并保证在代码构建-测试-部署(CBTD)循环中的质量和易再现性。而不使用maven.xml来描述要完成的任务,任务和插件都在pom.xml文件中加以配置。当要运行一个任务或者完成一个目标,Maven将察看当前文件夹中的POM。读取POM,获取必要的配置信息,然后运行。
项目依赖,可运行目标,插件的构建基本信息等都可以再POM中声明。其他的一些信息也可以,如:项目版本、描述信息、开发人员、邮件列表等等。

Super POM
Super POM是Maven的默认POM。在没有明确声明的情况下,所有的POM都继承了Super POM,所有的在Super POM中声明的,都将通过继承给您自己的项目。
代码片断 Super POM for Maven 2.1.x

Minimal POM

  • 最小的POM需要如下的信息:
  • 项目根标签
  • modelVersion –因该设置4.0.0
  • groupId –项目组的id
  • artifactId – 项目的id
  • version –版本

<!–[if gte mso 9]&gt; Normal 0 21 &lt;![endif]–>

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany.app</groupId>
    <artifactId>my-app</artifactId>
    <version>1</version>
</project>

一个POM需要groupId,artifactId,和version来加以配置。这三个值共同构成了一个完整而且符合标准的项目名:以如下的形势

<groupId>:<artifactId>:<version>。
依照上面的例子,完整达标的项目名为:com.mycompany.app:my-app:1。

同样,在第一节中提到的,那些没有被申明的设置细节,Maven会使用默认值。其中的一个就是packaging类型。每个Maven项目都有一个packaging类型。如果申明,默认为jar方式。
此外,当您看到上面的minimal POM时,资源仓库(repositories)并没有申明,如果您构建你的这个项目,那就会继承Super POM中的申明,您需要的相关包和库会通过地址http://repo1.maven.org/maven2下载.

项目继承
POM中被合并的元素如下:

  • dependencies
  • developers and contributors
  • plugin list(including reports)
  • plugin execution with matching ids
  • plugin configuration
  • resources

Super POM是一个项目继承的例子,虽然您也可以自己申明您的POM的父POM。以下是一些例子。


Create my iGoogle Background

04/30/2008

Friendlies igoogle

Last night I found the API introduction für igoogle background and theme. There are so many people has created the igoogle für self and published on for others. It gread! I tried to create one for myself. Here is result.


Begin to blog

04/15/2008

Seit lange Zeit habe ich vor, selbst eine Weblog zustarten. Hier begine ich meine Weblog mit die erste Post.

Es ist immer noch offen, wie und wo ich meine Deplomarbeit anfangen kann.Aber Morgen wird ein Entscheidungstag sein. Durchhalten, Morgen wird besser!