-
linux命令总结
2008-02-18 15:18:32
dos2unix $file > /dev/null 2>&1
转换格式,去掉^M,并不输出提示"dos2unix: converting file jdbc.properties to UNIX format ..." -
jsp自动编译
2007-10-24 17:52:22
利用ant+jasper来完成
<project name="Webapp Precompilation" default="all" basedir=".">
<target name="jspc" >
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${tomcat.home}/bin">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<jasper2
validateXml="false"
uriroot="${webapp.path}"
webXmlFragment="${webapp.path}/WEB-INF/gweb.xml"
ōutputDir="${webapp.path}/WEB-INF/src" />
</target>
<target name="compile">
<mkdir dir="${webapp.path}/WEB-INF/classes"/>
<mkdir dir="${webapp.path}/WEB-INF/lib"/><javac destdir="${webapp.path}/WEB-INF/classes"
ōptimize="off"
debug="on" failonerror="false"
srcdir="${webapp.path}/WEB-INF/src"
excludes="**/*.smap"
encoding="UTF-8" fork="true" memoryMaximumSize="512m">
<classpath>
<pathelement location="${webapp.path}/WEB-INF/classes"/>
<fileset dir="${webapp.path}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/common/classes"/>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/shared/classes"/>
<fileset dir="${tomcat.home}/shared/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/bin">
<include name="*.jar"/>
</fileset>
</classpath>
<include name="**" />
<exclude name="tags/**" />
</javac></target>
<target name="all" depends="jspc,compile">
</target></project>
-
maven 生成jar pom sha1
2007-08-03 10:18:36
build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="tyy" default="checksum">
<target name="checksum" descrīption="Generate checksum file for jar and pom">
<checksum algorithm="SHA" fileext=".sha1">
<fileset dir="d:/temp/test" id="id">
<include name="**/*.pom" />
<include name="**/*.jar" />
<include name="**/*.xml" />
<exclude name="**/*.sh1" />
</fileset>
</checksum>
</target>
</project>;pom.xml
<?xml version="1.0" encoding="UTF-8"?><project>
<modelVersion>4.0.0</modelVersion>
<groupId>crsapi</groupId>
<artifactId>crsapi</artifactId>
<version>1.3</version>
<descrīption>Auto generated POM</descrīption>
</project>通过运行以上的build.xml,可以生成jar和pom和加密文件sha1
-
转maven实战项目
2007-07-17 22:53:04
Mave项目是开放源代码公司Apache的又一力作,是项目管理的利器,是针对Ant项目的不足而开发的,除了拥有Ant的构建项目的特色外,还有项目高级管理工具,项目管理者可以轻松地了解项目的各种情况。下面结合本人对Maven的了解和实践,特总结如下:
u Maven的下载和安装
u Maven的配置和管理
u Maven项目继承问题说明
u Maven和VSS集成
u Maven 定制javadoc
u 常用的命令goal
u Maven注意事项
Maven的下载和安装
1) 下载Maven,在http://maven.apache.org/start/download.html地址下载Maven的最新版本(点击windows.exe,我的操作系统是windows),即到如下下载地址 http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-1.0.2.exe,我使用Http下载(点击http://apache.justdn.org/maven/binaries/maven-1.0.2.exe)下载到本地。(在网上看到许多网友下载Maven失败,所以加以详细说明)
2) 安装Maven,如果你的机器上没有安装j2sdk,安装将j2sdk,然后设置java-home(windows:我的电脑(右键)->属性->高级->环境变量->用户变量->新建(如:java-home C:/j2sdk1.4.2_01)),然后就可以直接运行maven-1.0.2.exe顺利安装。
3) 设置maven-home,类似于设置java-home,根据Maven的安装路径(${maven-home})设置如 maven-home d:/Maven1.02
4) 汉化Maven的dos控制台输出,用解压缩工具(如WinRar)打开${maven-home}/lib/maven.jar,找到并拖出org\apache\maven\messages\Message_zh_CN.properties,如果Message_zh_CN.properties文件的编码不是美国信息互换标准代码(ASCII),则使用java中的nativie2ascii命令把Message_zh_CN.properties转变为美国信息互换标准编码(ASCII)。并把转换后的文件名称也命名为Message_zh_CN.properties,然后拖入maven.jar的org\apache\maven\messages\中,覆盖原来的文件。转换步骤:打开dos界面,进入D:\bea\jdk141_03\bin>native2ascii Message_zh_CN.properties test.properties ,然后再把test.properties,重命名为Message_zh_CN.properties。
5) 开始->运行->cmd->进入dos界面,然后输入maven回车,如出现下面的情况,则说明安装成功。
Microsoft Windows 2000 [Version 5.00.2195]
(C) 版权所有 1985-2000 Microsoft Corp.
C:\Documents and Settings\lijj>maven
- __ __
- | \/ |__ _Apache__ ___
- | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
- |_| |_\__,_|\_/\___|_||_| v. 1.0.2
-
- BUILD SUCCESSFUL
- Total time: 1 seconds
- Finished at: Thu Mar 03 16:55:06 CST 2005
-
Maven的相关配置和管理
Maven的主要组件包括项目对象模型(Project Object Model POM),资源库(Repository)和目标(goals),现在根据实际例子来说明各个组件。其中项目对象模型一般是用project.xml来管理项目,而Repositroy主要提供项目所需要的jar文件,包括不同的版本,goals主要包括maven.xml和相关的插件(plugs)。
另外还包括属性文件如project.properties,build.properties.。属性文件的优先级是${user.home}/build.properties,${basedir}/build.properties,${basedir}/project.properties,(其中${user.home}表示本用户目录如C:\Documents and Settings\lijj,${basedir}表示项目project.properties所在目录,如D:\maventest)优先级前者最高,后者最低。即后者定义了某属性,前者也定义了该同名的属性,则以前者为准。由于Maven在项目管理方面有继承的概念,但不适合于build.properties文件。所以我们在项目管理中一般不用build.properties,只用project.properties文件来定义项目所需的属性。
创建项目
象我们平常创建项目一样,创建一个工作目录(d:/maventest),并把相关项目文件(如jsp,java,properties,img,js,xml等等)copy到该目录下
创建项目所需要的lib(即.jar文件)
因为maven倡导的思想是通过网络来实现项目管理,因此使用CVS来控制版本,我们现在更多的是采用VSS(source safe)来控制版本。Maven的Repository就体现了集中管理资源的思想,根据项目所要用到的jar资源文件进行网络统一管理,而我们现在更趋向于使用本机的资源文件。
1)首先在项目的属性文件project.properties中定义
##本地资源位置
maven.repo.local=d:/Maven 1.0.2/repository
##是否使用远程repository
maven.repo.remote.enabled=false
2)其次在本地的资源库中创建该项目所要使用lib,如d:/Maven 1.0.2/repository/bjcy/jars,然后把该项目所用的jar 文件copy到该目录(d:/Maven 1.0.2/repository/bjcy/jars)下,weblogic.jar, appmodules.jar,opendata.jar等等,使用解压缩工具(如WinRar)打开这些jar文件,找META-INF目录下的MANIFEST.MF文件,如果没有找到表明没有版本说明,则修改文件名(如jarname.jar->jarname-.jar,在文件名后加一横线),如果找到MANIFEST.MF文件,打开后看到Manifest-Version: 1.0,则表示该jar文件的版本号为1.0,修改文件名(如jarname.jar->jarname-1.0.jar)
3) 最后在project.xml文件中写明该项目要依赖的资源
<!-- jar files the project is dependent on -->
<dependencies>
<dependency>
<groupId>bjcy</groupId>
<artifactId>weblogic</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>bjcy</groupId>
<artifactId>appmodules</artifactId>
</dependency>
。。。。。。。。。
</dependencies>
该文档表示weblogic.jar文件的版本是1.0,appmodules.jar文件没有版本说明,且所有要依赖的jar都在bjcy/jars下面。
project.xml文件说明
project.xml是Maven项目管理的核心文件,主要说明项目的必须的内容
<?xml version="1.0" encoding="gb2312"?>
<!--encoding=”gb2312”表示支持中文-->
<project>
<!-- the version of maven's project object model -->
<pomVersion>3</pomVersion>
<!-- a unique name for this project -->
<id>prjcyspapp</id>
<!-- a short but descrīptive name for the project -->
<name>prjcyspapp</name>
<!-- The version of the project under development, e.g.
1.1, 1.2, 2.0-SNAPSHOT -->
<currentVersion>1.0</currentVersion>
<!-- details about the organization that 'owns' the project -->
<organization>
<name>北京××××软件公司</name>
<url>http://www.apache.org/</url>
<logo>http://maven.apache.org/images/jakarta-logo-blue.gif</logo>
</organization>
<!-- the year the project started -->
<inceptionYear>2005</inceptionYear>
<package>prjcyspapp</package>
<logo>http://maven.apache.org/images/maven.jpg</logo>
<descrīption>北京市××区网上审批系统</descrīption>
<!-- a short descrīption of what the project does -->
<shortDescrīption>××区网上审批在线服务系统是在北京市的统一领导下,按照统一规划、统一领导、改进服务、提高效率的原则,以推进行政审批制度改革、优化发展环境为目的,以服务企业、服务纳税人为根本宗旨,以北京市电子政务网络平台为依托,在现有××区投资服务大厅网上咨询审批系统的基础上,进一步改造升级,优化整合资源,建立统一的、面向社会公众的××区网上审批在线服务系统平台,提高办事效率和公共服务质量。</shortDescrīption>
<!-- the project home page -->
<url>http://maven.apache.org/reference/plugins/examples/</url>
<issueTrackingUrl>http://nagoya.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
<siteAddress>jakarta.apache.org</siteAddress>
<siteDirectory>/www/maven.apache.org/reference/plugins/examples/</siteDirectory>
<distributionDirectory>/www/maven.apache.org/builds/</distributionDirectory>
<!-- the version control repository and http url for online access
the connection element has the form:
scm:<system>:<system specific connection string> -->
<repository>
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/examples</connection>
<url>http://cvs.apache.org/viewcvs/maven-plugins/examples/</url>
</repository>
<!-- any mailing lists for the project -->
<mailingLists/>
<!-- who the developers are for the project -->
<developers>
<developer>
<name>张三</name>
<id>anli</id>
<email>anli@sohu.com</em
-
pom.xml
2007-07-17 22:46:10
什么是pom?
pom作为项目对象模型。通过xml表示maven项目,使用pom.xml来实现。主要描述了项目:包括配置文件;开发者需要遵循的规则,缺陷管理系统,组织和licenses,项目的url,项目的依赖性,以及其他所有的项目相关因素。
快速察看:
<project>
<modelVersion>4.0.0</modelVersion>
<!-- The Basics -->
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<packaging>...</packaging>
<dependencies>...</dependencies>
<parent>...</parent>
<dependencyManagement>...</dependencyManagement>
<modules>...</modules>
<properties>...</properties>
<!-- Build Settings -->
<build>...</build>
<reporting>...</reporting>
<!-- More Project Information -->
<name>...</name>
<descrīption>...</descrīption>
<url>...</url>
<inceptionYear>...</inceptionYear>
<licenses>...</licenses>
<organization>...</organization>
<developers>...</developers>
<contributors>...</contributors>
<!-- Environment Settings -->
<issueManagement>...</issueManagement>
<ciManagement>...</ciManagement>
<mailingLists>...</mailingLists>
<scm>...</scm>
<prerequisites>...</prerequisites>
<repositories>...</repositories>
<pluginRepositories>...</pluginRepositories>
<distributionManagement>...</distributionManagement>
<profiles>...</profiles>
</project>
基本内容:
POM包括了所有的项目信息。
maven 相关:
pom定义了最小的maven2元素,允许groupId,artifactId,version。所有需要的元素
- groupId:项目或者组织的唯一标志,并且配置时生成的路径也是由此生成,如org.codehaus.mojo生成的相对路径为:/org/codehaus/mojo
- artifactId: 项目的通用名称
- version:项目的版本
- packaging: 打包的机制,如pom, jar, maven-plugin, ejb, war, ear, rar, par
- classifier: 分类
主要为依赖,继承,合成
依赖关系:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.0</version>
<type>jar</type>
<scope>test</scope>
<optional>true</optional>
</dependency>
...
</dependencies>
- groupId, artifactId, version:描述了依赖的项目唯一标志
可以通过以下方式进行安装:
- 使用以下的命令安装:
- mvn install:install-file –Dfile=non-maven-proj.jar –DgroupId=some.group –DartifactId=non-maven-proj –Dversion=1
- 创建自己的库,并配置,使用deploy:deploy-file
- 设置此依赖范围为system,定义一个系统路径。不提倡。
- type:相应的依赖产品包形式,如jar,war
- scope:用于限制相应的依赖范围,包括以下的几种变量:
- compile :默认范围,用于编译
- provided:类似于编译,但支持你期待jdk或者容器提供,类似于classpath
- runtime:在执行时,需要使用
- test:用于test任务时使用
- system:需要外在提供相应得元素。通过systemPath来取得
- systemPath: 仅用于范围为system。提供相应的路径
- optional: 标注可选,当项目自身也是依赖时。用于连续依赖时使用
外在告诉maven你只包括指定的项目,不包括相关的依赖。此因素主要用于解决版本冲突问题
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
<version>2.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
</exclusions>
</dependency>
表示项目maven-embedder需要项目maven-core,但我们不想引用maven-core
继承关系
另一个强大的变化,maven带来的是项目继承。主要的设置:
定义父项目
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>my-parent</artifactId>
<version>2.0</version>
<packaging>pom</packaging>
</project>
packaging 类型,需要pom用于parent和合成多个项目。我们需要增加相应的值给父pom,用于子项目继承。主要的元素如下:
- 依赖型
- 开发者和合作者
- 插件列表
- 报表列表
- 插件执行使用相应的匹配ids
- 插件配置
- 子项目配置
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codehaus.mojo</groupId>
<artifactId>my-parent</artifactId>
<version>2.0</version>
<relativePath>../my-parent</relativePath>
</parent>
<artifactId>my-project</artifactId>
</project>
relativePath可以不需要,但是用于指明parent的目录,用于快速查询。
dependencyManagement:
用于父项目配置共同的依赖关系,主要配置依赖包相同因素,如版本,scope。
合成(或者多个模块)
一个项目有多个模块,也叫做多重模块,或者合成项目。
如下的定义:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>my-parent</artifactId>
<version>2.0</version>
<modules>
<module>my-project1<module>
<module>my-project2<module>
</modules>
</project>
build 设置
主要用于编译设置,包括两个主要的元素,build和report
build
主要分为两部分,基本元素和扩展元素集合
注意:包括项目build和profile build
<project>
<!-- "Project Build" contains more elements than just the BaseBuild set -->
<build>...</build>
<profiles>
<profile>
<!-- "Profile Build" contains a subset of "Project Build"s elements -->
<build>...</build>
</profile>
</profiles>
</project>
基本元素
<build>
<defaultGoal>install</defaultGoal>
<directory>${basedir}/target</directory>
<finalName>${artifactId}-${version}</finalName>
<filters>
<filter>filters/filter1.properties</filter>
</filters>
...
</build>
- defaultGoal: 定义默认的目标或者阶段。如install
- directory: 编译输出的目录
- finalName: 生成最后的文件的样式
- filter: 定义过滤,用于替换相应的属性文件,使用maven定义的属性。设置所有placehold的值
资源(resources)
你项目中需要指定的资源。如spring配置文件,log4j.properties
<project>
<build>
...
<resources>
<resource>
<targetPath>META-INF/plexus</targetPath>
<filtering>false</filtering>
<directory>${basedir}/src/main/plexus</directory>
<includes>
<include>configuration.xml</include>
</includes>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
</resource>
</resources>
<testResources>
...
</testResources>
...
</build>
</project>
- resources: resource的列表,用于包括所有的资源
- targetPath: 指定目标路径,用于放置资源,用于build
- filtering: 是否替换资源中的属性placehold
- directory: 资源所在的位置
- includes: 样式,包括那些资源
- excludes: 排除的资源
- testResources: 测试资源列表
在build时,执行的插件,比较有用的部分,如使用jdk 5.0编译等等
<project>
<build>
...
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.0</version>
<extensions>false</extensions>
<inherited>true</inherited>
<configuration>
<classifier>test</classifier>
</configuration>
<dependencies>...</dependencies>
<executions>...</executions>
</plugin>
</plugins>
</build>
</project>
- extensions: true or false,是否装载插件扩展。默认false
- inherited: true or false,是否此插件配置将会应用于poms,那些继承于此的项目
- configuration: 指定插件配置
- dependencies: 插件需要依赖的包
- executions: 用于配置execution目标,一个插件可以有多个目标。
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>echodir</id>
<goals>
<goal>run</goal>
</goals>
<phase>verify</phase>
<inherited>false</inherited>
<configuration>
<tasks>
<echo>Build Dir: ${project.build.directory}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
说明:
- id:规定execution 的唯一标志
- goals: 表示目标
- phase: 表示阶段,目标将会在什么阶段执行
- inherited: 和上面的元素一样,设置false maven将会拒绝执行继承给子插件
- configuration: 表示此执行的配置属性
插件管理
pluginManagement:插件管理以同样的方式包括插件元素,用于在特定的项目中配置。所有继承于此项目的子项目都能使用。主要定义插件的共同元素
扩展元素集合
主要包括以下的元素:
Directories
用于设置各种目录结构,如下:
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<scrīptSourceDirectory>${basedir}/src/main/scrīpts</scrīptSourceDirectory>
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
<outputDirectory>${basedir}/target/classes</outputDirectory>
<testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory>
...
</build>
Extensions
表示需要扩展的插件,必须包括进相应的build路径。
<project>
<build>
...
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-alpha-3</version>
</extension>
</extensions>
...
</build>
</project>
Reporting
用于在site阶段输出报表。特定的maven 插件能输出相应的定制和配置报表。
<reporting>
<plugins>
<plugin>
<outputDirectory>${basedir}/target/site</outputDirectory>
<artifactId>maven-project-info-reports-plugin</artifactId>
<reportSets>
<reportSet></reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
Report Sets
用于配置不同的目标,应用于不同的报表
<reporting>
<plugins>
<plugin>
...
<reportSets>
<reportSet>
<id>sunlink</id>
<reports>
<report>javadoc</report>
</reports>
<inherited>true</inherited>
<configuration>
<links>
<link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
</links>
</configuration>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
更多的项目信息
name:项目除了artifactId外,可以定义多个名称
descrīption: 项目描述
url: 项目url
inceptionYear:创始年份
Licenses
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
Organization
配置组织信息
<organization>
<name>Codehaus Mojo</name>
<url>http://mojo.codehaus.org</url>
</organization>
Developers
配置开发者信息
<developers>
<developer>
<id>eric</id>
<name>Eric</name>
<email>eredmond@codehaus.org</email>
<url>http://eric.propellors.net</url>
<organization>Codehaus</organization>
<organizationUrl>http://mojo.codehaus.org</organizationUrl>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
<timezone>-6</timezone>
<properties>
<picUrl>http://tinyurl.com/prv4t</picUrl>
</properties>
</developer>
</developers>
Contributors
<contributors>
<contributor>
<name>Noelle</name>
<email>some.name@gmail.com</email>
<url>http://noellemarie.com</url>
<organization>Noelle Marie</organization>
<organizationUrl>http://noellemarie.com</organizationUrl>
<roles>
<role>tester</role>
</roles>
<timezone>-5</timezone>
<properties>
<gtalk>some.name@gmail.com</gtalk>
</properties>
</contributor>
</contributors>
环境设置
Issue Management
定义相关的bug跟踪系统,如bugzilla,testtrack,clearQuest等
<issueManagement>
<system>Bugzilla</system>
<url>http://127.0.0.1/bugzilla</url>
</issueManagement>
Continuous Integration Management
连续整合管理,基于triggers或者timings
<ciManagement>
<system>continuum</system>
<url>http://127.0.0.1:8080/continuum</url>
<notifiers>
<notifier>
<type>mail</type>
<sendOnError>true</sendOnError>
<sendOnFailure>true</sendOnFailure>
<sendOnSuccess>false</sendOnSuccess>
<sendOnWarning>false</sendOnWarning>
<configuration><address>continuum@127.0.0.1</address></configuration>
</notifier>
</notifiers>
</ciManagement>
Mailing Lists
<mailingLists>
<mailingList>
<name>User List</name>
<subscribe>user-subscribe@127.0.0.1</subscribe>
<unsubscribe>user-unsubscribe@127.0.0.1</unsubscribe>
<post>user@127.0.0.1</post>
<archive>http://127.0.0.1/user/</archive>
<otherArchives>
<otherArchive>http://base.google.com/base/1/127.0.0.1</otherArchive>
</otherArchives>
</mailingList>
</mailingLists>
SCM
软件配置管理,如cvs 和svn
<scm>
<connection>scm:svn:http://127.0.0.1/svn/my-project</connection>
<developerConnection>scm:svn:https://127.0.0.1/svn/my-project</developerConnection>
<tag>HEAD</tag>
<url>http://127.0.0.1/websvn/my-project</url>
</scm>
Repositories
配置同setting.xml中的开发库
Plugin Repositories
配置同 repositories
Distribution Management
用于配置分发管理,配置相应的产品发布信息,主要用于发布,在执行mvn deploy后表示要发布的位置
1 配置到文件系统
<distributionManagement>
<repository>
<id>proficio-repository</id>
<name>Proficio Repository</name>
<url>file://${basedir}/target/deploy</url>
</repository>
</distributionManagement>
2 使用ssh2配置
<distributionManagement>
<repository>
<id>proficio-repository</id>
<name>Proficio Repository</name>
<url>scp://sshserver.yourcompany.com/deploy</url>
</repository>
</distributionManagement>
3 使用sftp配置
<distributionManagement>
<repository>
<id>proficio-repository</id>
<name>Proficio Repository</name>
<url>sftp://ftpserver.yourcompany.com/deploy</url>
</repository>
</distributionManagement>
4 使用外在的ssh配置
编译扩展用于指定使用wagon外在ssh提供,用于提供你的文件到相应的远程服务器。
<distributionManagement>
<repository>
<id>proficio-repository</id>
<name>Proficio Repository</name>
<url>scpexe://sshserver.yourcompany.com/deploy</url>
</repository>
</distributionManagement>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>1.0-alpha-6</version>
</extension>
</extensions>
</build>
5 使用ftp配置
<distributionManagement>
<repository>
<id>proficio-repository</id>
<name>Proficio Repository</name>
<url>ftp://ftpserver.yourcompany.com/deploy</url>
</repository>
</distributionManagement>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-alpha-6</version>
</extension>
</extensions>
</build>
repository 对应于你的开发库,用户信息通过settings.xml中的server取得
Profiles
类似于settings.xml中的profiles,增加了几个元素,如下的样式:
<profiles>
<profile>
<id>test</id>
<activation>...</activation>
<build>...</build>
<modules>...</modules>
<repositories>...</repositories>
<pluginRepositories>...</pluginRepositories>
<dependencies>...</dependencies>
<reporting>...</reporting>
<dependencyManagement>...</dependencyManagement>
<distributionManagement>...</distributionManagement>
</profile></profiles>
-
cvs chacl权限
2007-06-29 10:39:12
Keywords cvs chacl rchacl read write tag create all none 权限
Author:Bob对于cvs chacl [-R] [-r branch] [-u user] [-j branch] [-n] [-p priority] [-m message] [-a [no]{read|write|create|tag|control|all|none}[,...]] [-d] [file or directory...]
或
cvs rchacl [-R] [-r branch] [-u user] [-j branch] [-n] [-p priority] [-m message] [-a [no]{read|write|create|tag|control|all|none}[,...]] [-d] [file or directory...]例: cvs chacl -R -a read,write -u user1
现在分别对这几个参数做一下说明:
read 读权限
write 写权限
create 创建目录的权限
tag 创建tag权限
control 控制权限
all 所有权限
none 没有任何权限
需要说明的是,read|write|create|tag|control 之间没有权力大小之分。如果有write权限的话,未必有read权限。如你只给某一个用户写的权限的话,他是无法读出的。对于有写权限的人,一般会给他读的权限(要不怎么写啊)。对于create 只有创建目录的权限,如果目录下面有文件,你必须还要有write权限才行。
对于control 如果某用户对某目录有control权限,那么这个用户可以使用cvs chacl命令更改这个目录的权限。
对于all 如果某个用户对某个目录有all权限,那么这个用户将拥有所有权限。
对于tag 不需要有wirte权限也可以tag,但应该给其read权限。
需要说明的是:CVS不仅可以对目录做权限控制,还能对文件做权限控制。
运行环境:wincvs .20 cvsnt 2.5