- 浏览: 237099 次
- 性别:
- 来自: 苏州
文章分类
- 全部博客 (188)
- Java (68)
- SQL (9)
- JavaScript (1)
- Spring (3)
- Struts (0)
- OS (4)
- Mywork (8)
- IT News (10)
- Passtime (15)
- English (11)
- SCJP (2)
- Linux (4)
- Maven (6)
- OpenSource (1)
- 持续集成CI (1)
- CVS (3)
- Hudson (3)
- OpenID (5)
- Web (8)
- Project Management (6)
- CRM (3)
- CaseStudy (2)
- SSO (1)
- OpenLDAP (4)
- Thinking (1)
- JGroup (1)
最新评论
-
guji528:
谢谢分享!
一些关于Emma的资料 -
atgoingguoat:
我也碰到这个问题
Linux 下具体如何处理.
java.net.UnknownHostException: ibatis.apache.org -
zerostar88:
http://www.limodev.cn/blog/arch ...
HTC G3 刷 Recovery and ROM -
zerostar88:
but DES now is deprecated, we u ...
DES/CBC/PKCS5Padding密码 -
xnxylxh:
辛苦了
数字证书
最近看maven,找到一个有用的中文参考教程:
http://www.family168.com/oa/maven2/html/
http://www.zhlwish.com/tag/maven/
评论
7 楼
zerostar88
2010-02-15
Available Variables
Project Model Variables
Any field of the model that is a single value element can be referenced as a variable. For example, ${project.groupId}, ${project.version}, ${project.build.sourceDirectory} and so on. Refer to the POM reference to see a full list of properties.
These variables are all referenced by the prefix "project.". You may also see references with pom. as the prefix, or the prefix omitted entirely - these forms are now deprecated and should not be used.
Special Variables
basedir The directory that the current project resides in.
project.baseUri The directory that the current project resides in, represented as an URI. Since Maven 2.1.0
maven.build.timestamp The timestamp that denotes the start of the build. Since Maven 2.1.0-M1
The format of the build timestamp can be customized by declaring the property maven.build.timestamp.format as shown in the example below:
<project>
...
<properties>
<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
</properties>
...
</project>
The format pattern has to comply with the rules given in the API documentation for SimpleDateFormat. If the property is not present, the format defaults to the value already given in the example.
Properties
You are also able to reference any properties defined in the project as a variable. Consider the following example:
<project>
...
<properties>
<mavenVersion>2.1</mavenVersion>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${mavenVersion}</version>
</dependency>
</dependencies>
...
</project>
Project Model Variables
Any field of the model that is a single value element can be referenced as a variable. For example, ${project.groupId}, ${project.version}, ${project.build.sourceDirectory} and so on. Refer to the POM reference to see a full list of properties.
These variables are all referenced by the prefix "project.". You may also see references with pom. as the prefix, or the prefix omitted entirely - these forms are now deprecated and should not be used.
Special Variables
basedir The directory that the current project resides in.
project.baseUri The directory that the current project resides in, represented as an URI. Since Maven 2.1.0
maven.build.timestamp The timestamp that denotes the start of the build. Since Maven 2.1.0-M1
The format of the build timestamp can be customized by declaring the property maven.build.timestamp.format as shown in the example below:
<project>
...
<properties>
<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
</properties>
...
</project>
The format pattern has to comply with the rules given in the API documentation for SimpleDateFormat. If the property is not present, the format defaults to the value already given in the example.
Properties
You are also able to reference any properties defined in the project as a variable. Consider the following example:
<project>
...
<properties>
<mavenVersion>2.1</mavenVersion>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${mavenVersion}</version>
</dependency>
</dependencies>
...
</project>
5 楼
zerostar88
2010-02-15
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.4</source>
<target>1.4</target>
</configuration>
</plugin>
</plugins>
</build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.4</source>
<target>1.4</target>
</configuration>
</plugin>
</plugins>
</build>
4 楼
zerostar88
2010-02-15
maven2 其实用JDK1.4.2也可以编译的
3 楼
zerostar88
2010-02-11
mvn package -Dmaven.test.skip=true
2 楼
zerostar88
2010-02-08
在maven中有完整的开发生命周期,但有时候却不能按自己的想法灵活的设置一些任务,这就想到了ANT(我想到的maven的开发者们也想到了,所以有一个maven-antrun-plugin),可以在maven中执行ant任务.
在Maven中执行ant任务有两种方法:
1、在pom.xml中直接写ANT任务
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="E:workspaceRB_MyFaces argetclasses">
<fileset includes="hibernate.cfg.xml" dir="E:workspaceRB_MyFacessrcmainjava"></fileset>
<fileset includes="MessageResources.properties" dir="E:workspaceRB_MyFacessrcmainjava"></fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
2、在pom.xml中调用ANT文件
把上例中的<tasks></tasks>中的任务移到一个build.xml文件中,然后加入下面这句话
<ant antfile="build.xml" target="default" />
就可以执行build.xml文件中 default任务了.
在Maven中执行ant任务有两种方法:
1、在pom.xml中直接写ANT任务
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="E:workspaceRB_MyFaces argetclasses">
<fileset includes="hibernate.cfg.xml" dir="E:workspaceRB_MyFacessrcmainjava"></fileset>
<fileset includes="MessageResources.properties" dir="E:workspaceRB_MyFacessrcmainjava"></fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
2、在pom.xml中调用ANT文件
把上例中的<tasks></tasks>中的任务移到一个build.xml文件中,然后加入下面这句话
<ant antfile="build.xml" target="default" />
就可以执行build.xml文件中 default任务了.
1 楼
zerostar88
2010-02-02
三种方案。
1.使用jetty进行测试,有maven插件,这个是嵌入式的,速度要快很多。
Java代码
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.5</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.5</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
</plugin>
直接执行Java代码
mvn jetty:run
mvn jetty:run
2.要使用tomcat 也不难,最简单的方法使用NetBeans,从plugin中安装maven插件,这样,你可以直接在项目属性中选择使用tomcat 等,并且它同样支持增量开发(Compile on Save , Deploy on Save)
3.使用 Cargo(刚刚发布了1.0)maven 插件管理 tomcat,一样的轻松方便。参考
http://cargo.codehaus.org/Maven2+Plugin+Tips
3.maven 打包命令
mvn war:war
但有的时候可能会打包失败
mvn -o package -Dmaven.test.skip=true
这条语句基本都可以成功。
4.maven 生成javadoc
mvn javadoc:javadoc
1.使用jetty进行测试,有maven插件,这个是嵌入式的,速度要快很多。
Java代码
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.5</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.5</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
</plugin>
直接执行Java代码
mvn jetty:run
mvn jetty:run
2.要使用tomcat 也不难,最简单的方法使用NetBeans,从plugin中安装maven插件,这样,你可以直接在项目属性中选择使用tomcat 等,并且它同样支持增量开发(Compile on Save , Deploy on Save)
3.使用 Cargo(刚刚发布了1.0)maven 插件管理 tomcat,一样的轻松方便。参考
http://cargo.codehaus.org/Maven2+Plugin+Tips
3.maven 打包命令
mvn war:war
但有的时候可能会打包失败
mvn -o package -Dmaven.test.skip=true
这条语句基本都可以成功。
4.maven 生成javadoc
mvn javadoc:javadoc
发表评论
-
Java 代码块加载顺序
2015-07-19 13:29 607静态代码块 > 构造代码块 > 构造方法 pu ... -
Sprint JPA Test
2015-02-14 13:45 859@RunWith(SpringJUnit4ClassRunn ... -
WARNING: JMockit was initialized on demand, which may cause certain tests to fai
2013-08-05 09:04 2324When we using Jmokit and Junit ... -
Common log4j Console output when unit testing
2013-08-02 10:23 752#set up stdout appenderlog4j.ap ... -
JGroups 广播检查
2013-01-08 09:52 917先下载JGroup jar包 设置到环境变量CLASSPAT ... -
(转)一步步优化JVM4:决定Java堆的大小以及内存占用
2012-09-22 10:45 937一步步优化JVM4:决定Java堆的大小以及内存占用 htt ... -
让开发自动化: 用 Eclipse 插件提高代码质量
2012-08-02 22:25 1095让开发自动化: 用 Eclipse ... -
从 Java 代码到 Java 堆 理解和优化您的应用程序的内存使用
2012-08-01 09:29 1009从 Java 代码到 Java 堆 理解和优化您的应用程 ... -
Unable to read TLD from JAR file
2011-07-06 14:35 1366Today I try myBatis project Jpe ... -
Java Trouble shooting from IBM
2011-06-16 15:50 785Here is a good repository for J ... -
DES/CBC/PKCS5Padding密码
2011-05-10 10:06 3709DES/CBC/PKCS5Padding 加密解密 i ... -
【java】AES加密解密 AES/CBC/PKCS5Padding
2011-05-10 10:05 18188<Source>http://www.cnblog ... -
Tomcat JNDI configuration
2010-10-18 14:15 1128Tomcat JNDI configuration ... -
(转)设计与开发 JAX-WS 2.0 Web 服务
2010-10-11 08:33 1029https://www6.software.ibm.com/d ... -
初学者如何开发出高质量J2EE系统
2010-09-16 08:34 859(转自CSDN)初学者如何开发出高质量J2EE系统 S ... -
Jpetstore
2010-09-16 08:32 1055http://www.hudong.com/wiki/Jpet ... -
Google SAML2 SSO
2010-09-09 16:40 1536Source: http://code.google.com/ ... -
(Forward)Debug your Java code with ease using JPDA
2010-09-07 13:02 985Debug your Java code with ease ... -
(Forward)程序员从初级到中级10个秘诀
2010-08-22 11:06 812http://sd.csdn.net/a/20100820/2 ... -
为什么5%的技术人员开发效率是其他95%的20倍?
2010-08-22 10:54 870Source: http://sd.csdn.net/a/20 ...
相关推荐
### Maven - Maven 教程概览 #### 一、Apache Maven —— 概述 **1.1 什么是 Maven** Apache Maven 是一个基于项目对象模型(Project Object Model, POM)的软件项目管理和理解工具。它能够从一个中央信息源管理...
### Maven 下载、安装、配置与使用教程 Maven 是一款功能强大的自动化构建工具,主要用于 Java 项目的构建、依赖管理和项目信息管理等。本教程旨在详细介绍 Maven 的下载、安装、配置以及基本使用方法。 #### 1. ...
Maven 2 is a powerful tool that promotes convention over configuration and you need...tutorial provides an example of how to make Maven and Eclipse collaborate. Also covers the popular JSF Web framework.
A step-by-step tutorial guide full of pragmatic examples Who This Book Is For If you are a Java developer or a manager who has experience with Apache Maven and want to extend your knowledge, then this...
打包 mvn package 运行 使用 java 命令运行: java -cp target/hello-1.0.jar:$HOME/.m2/repository/org/json/json/20180813/json-20180813.jar com.fundebug.Hello 使用 mvn 命令运行: mvn exec:java -Dexec....
- Getting Started Tutorial:官方入门教程,适合初学者。 - Build Cookbook:包含各种构建场景的实例和解决方案。 - POM Reference:详述了Project Object Model (POM)的配置参考。 - Settings Reference:解释...
【Apache Maven基础】 Apache Maven是一个基于项目对象模型(Project Object Model,POM)的概念,用于管理Java项目的构建、报告和依赖关系。它简化了构建过程,通过读取POM.xml文件来理解项目配置,自动处理项目的...
### Java-Maven-Eclipse-JSF 教程知识点详解 #### Maven 2:强大的构建工具 Maven 2 是一个强大的工具,它强调约定优于配置的原则。通过使用 Maven 2,开发者可以更容易地管理项目的依赖关系、构建过程以及版本...
Maven仓库,通常被称为“Maven Repo”,是Maven项目管理和构建工具的核心组成部分。这个“maven repo”是你个人项目的依赖存储库,它包含了许多Java库、框架和其他软件组件,这些组件以JAR文件的形式存储,供你的...
3. **设置Group ID和Artifact ID**:在新页面中,输入项目的基本信息,如Group ID(通常是组织或公司的域名倒序,如com.example)、Artifact ID(项目名称,如springmvc-tutorial)以及Version。点击“Finish”完成...
在“maven_java_tutorial”教程中,我们将深入学习Maven的核心概念和用法,包括以下几个方面: 1. **Maven项目结构**:Maven推崇的项目结构非常规范,包括src/main/java(源代码)、src/main/resources(资源文件)...
- **在线教程**:[https://www.baeldung.com/maven-tutorial-for-beginners](https://www.baeldung.com/maven-tutorial-for-beginners) - 适合初学者的教程,讲解了 Maven 的基本用法。 - **书籍**:《Maven实战》是...
An easy-to-follow, tutorial-based guide with chapters progressing from basic to advanced dependency management. Who this book is written for If you are working with Java or Java EE projects and you ...
本教程“perl6-tutorial-cn”是"The Perl Maven's Perl 6 Tutorial"的中文翻译,为想要学习Perl 6的中文读者提供了极大的便利。 Perl 6 的设计目标之一是保持Perl 5的灵活性,同时引入更清晰的语法和强大的新特性。...
标题为“Gradle Tutorial”的文档是一份关于Gradle构建工具的英文教程,介绍了Gradle的版本信息、实现方式、核心概念以及如何快速上手。文档指出,Gradle是类似于Maven和Ant的构建工具,它目前正开始被更广泛地采用...
Maven依赖主要包含三部分的依赖:flink和hive的连接器,hive的依赖和hadoop的依赖。
这个“jbehave-tutorial-maste”压缩包很可能是JBehave的一个教程项目,旨在帮助用户了解并熟悉JBehave的基本用法和核心概念。 在JBehave中,故事是BDD的核心,它们描述了系统的功能需求,通常以简洁明了的文本形式...
本教程项目“tutorial-connection-pooling”旨在通过Maven构建工具,演示如何使用DBCP(Jakarta Commons DBCP,即Apache的一个数据库连接池实现)来创建和管理数据库连接。 1. **数据库连接池概念**:数据库连接池...