华风 发表于 2017-1-8 11:48:18

利用maven部署apache的jetspeed门户一

  我所使用的版本为:
  


Jetspeed-2 2.2.1;manen-2.2.1;apach-tomcat-6.0.18;jdk6;mysql5
  (参考官方文档。)
  第一部分:主要是自定义门户的生成。
  第二部分:自定义自己的portal设计;
  第三部分:Portlet的开发
  第四部分:Jetspeed Services
  




  


准备工作之下载软件:
  1、下载jetspeed,下载地址为http://portals.apache.org/jetspeed-2/download.html;下载其最新版本:jetspeed-2-2.2.1-source-release.zip,有兴趣的同学可以下载jetspeed-installer-2.2.1.jar,
  

  Jetspeed-2 标准安装版是带有Minimal 和 Demo ;它支持以下数据库:
  Derby (默认的), DB2, MySQL, MSSQL, Oracle, PostgreSQL, SapDB,同时在安装包里面提供ant脚本。
  2、下载maven2.2.1,下载地址为http://maven.apache.org/download.html,
  我这里使用的是:apache-maven-2.2.1-bin.zip
  3、下载tomcat6.0.18,下载地址为http://tomcat.apache.org/download-60.cgi
  


准备工作之设置maven环境变量
  4、把下载的maven-2.2.1解压出来,我解压的目录是:D:\opensource\apache-maven-2.2.1
  5、类似java的环境变量一样,右键我的电脑->属性->高级->环境变量->新建系统变量(用户变量也可以)->输入变量    名:M2_HOME,变量值:D:\opensource\apache-maven-2.2.1,编辑path,输入%M2_HOME%\bin;
  6、测试maven的环境变量是否配置正确,运行输入cmd,dos界面输入mvn -v,若显示类似如下显示,则表示配置maven变量正确。

C:\Documents and Settings\Administrator>mvn -v
Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0_10-rc2
Java home: D:\Program Files\Java\jdk1.6.0_10\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
C:\Documents and Settings\Administrator>
   利用maven生成一个新的自定义的petspeed,名为jetexpress
  1、在dos界面输入以下命令:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate \
-DarchetypeGroupId=org.apache.portals.jetspeed-2 \
-DarchetypeArtifactId=jetspeed-archetype \
-DarchetypeVersion=2.2.1 \
-DartifactId=jetexpress \
-Dpackage=org.apache.portals.tutorials \
-DgroupId=org.apache.portals.tutorials \
-Dversion=1.0-SNAPSHOT
   2、显示如下信息:

C:\Documents and Settings\Administrator>mvn org.apache.maven.plugins:maven-arch
type-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.apache.portals.jetspeed
2 -DarchetypeArtifactId=jetspeed-archetype -DarchetypeVersion=2.2.1 -DartifactI
=jetexpress -Dpackage=org.apache.portals.tutorials -DgroupId=org.apache.portals
tutorials -Dversion=1.0-SNAPSHOT
Scanning for projects...
------------------------------------------------------------------------
Building Maven Default Project
    task-segment: [org.apache.maven.plugins:maven-archetype-plugin:2.0-al
ha-4:generate] (aggregator-style)
------------------------------------------------------------------------
Preparing archetype:generate
No goals needed for project - skipping
Setting property: classpath.resource.loader.class => 'org.codehaus.plexu
.velocity.ContextClassLoaderResourceLoader'.
Setting property: velocimacro.messages.on => 'false'.
Setting property: resource.loader => 'classpath'.
Setting property: resource.manager.logwhenfound => 'false'.

Generating project in Interactive mode
No archetype repository found. Falling back to central repository (ht
p://repo1.maven.org/maven2).
Use -DarchetypeRepository=<your repository> if archetype's repository
is elsewhere.
Confirm properties configuration:
groupId: org.apache.portals.tutorials
artifactId: jetexpress
version: 1.0-SNAPSHOT
package: org.apache.portals.tutorials
Y: :

   3、回车,显示如下信息:

Y: : y
------------------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 5 seconds
Finished at: Fri Oct 29 15:09:03 CST 2010
Final Memory: 8M/14M
------------------------------------------------------------------------
C:\Documents and Settings\Administrator>
  同时,生成一个文件夹jetexpress。路径为:C:\Documents and Settings\Administrator\jetexpress

在上一步我们用Jetspeed Archetype for Maven生成的jetexpress, 他的结构内容如下:
    jetexpress/
|-- jetexpress-pa
|   |-- jetspeed-mvn-pa-pom.xml
|   |-- pom.xml
|   `-- src
|       `-- main
|         |-- java
|         |   `-- org
|         |       `-- apache
|         |         `-- portals
|         |               `-- tutorials
|         |                   `-- MyPortlet.java
|         `-- webapp
|               |-- WEB-INF
|               |   |-- portlet.xml
|               |   `-- web.xml
|               |-- help.jsp
|               |-- maximized.jsp
|               `-- normal.jsp
|-- jetexpress-portal
|   |-- jetspeed-mvn-portal-pom.xml
|   |-- pom.xml
|   `-- src
|       |-- main
|       |   `-- webapp
|       |       `-- WEB-INF
|       |         `-- pages
|       |               `-- default-page.psml
|       `-- sql
|         `-- min
|               `-- j2-seed.xml
|-- jetspeed-mvn-settings.xml
`-- pom.xml

配置tomcat容器和数据库的位置



在jetexpress根目录下的文件jetspeed-mvn-settings.xml 包含这应用服务器和数据库的位置信息。生成的项目是配置成使用tomcat作为应用服务器,derby作为数据库的。
 
找到 org.apache.jetspeed.server.home 配置参数 然后改成我们tomcat的目录,我的tomcat是放在
  D:\opensource\apache-tomcat-6.0.18

<org.apache.jetspeed.server.home>D:\opensource\apache-tomcat-6.0.18</org.apache.jetspeed.server.home>


找到 org.apache.jetspeed.production.database.url 配置参数. 直接把derby的数据库连接注释掉,开启mysql的连接;
配置内容如下:
 

<properties>
<org.apache.jetspeed.server.home>/change/this/apache-tomcat-6.0.18/</org.apache.jetspeed.server.home>
<org.apache.jetspeed.catalina.version.major>6</org.apache.jetspeed.catalina.version.major>

<org.apache.jetspeed.production.database.default.name>mysql</org.apache.jetspeed.production.database.default.name>
<org.apache.jetspeed.production.jdbc.driver.groupId>mysql</org.apache.jetspeed.production.jdbc.driver.groupId>
<org.apache.jetspeed.production.jdbc.driver.artifactId>mysql-connector-java</org.apache.jetspeed.production.jdbc.driver.artifactId>
<org.apache.jetspeed.production.jdbc.driver.version>5.1.6</org.apache.jetspeed.production.jdbc.driver.version>
<org.apache.jetspeed.production.database.driver>com.mysql.jdbc.Driver</org.apache.jetspeed.production.database.driver>
<org.apache.jetspeed.production.database.url><!]></org.apache.jetspeed.production.database.url>
<org.apache.jetspeed.production.database.user>username</org.apache.jetspeed.production.database.user>
<org.apache.jetspeed.production.database.password>password</org.apache.jetspeed.production.database.password>
    <!--
<org.apache.jetspeed.production.jdbc.driver.groupId>org.apache.derby</org.apache.jetspeed.production.jdbc.driver.groupId>
<org.apache.jetspeed.production.jdbc.driver.artifactId>derby</org.apache.jetspeed.production.jdbc.driver.artifactId>
<org.apache.jetspeed.production.jdbc.driver.version>10.3.2.1</org.apache.jetspeed.production.jdbc.driver.version>
<org.apache.jetspeed.production.database.default.name>derby</org.apache.jetspeed.production.database.default.name>
<org.apache.jetspeed.production.database.url>jdbc:derby:/tmp/jetspeed/derby/productiondb;create=true</org.apache.jetspeed.production.database.url>
<org.apache.jetspeed.production.database.driver>org.apache.derby.jdbc.EmbeddedDriver</org.apache.jetspeed.production.database.driver>
<org.apache.jetspeed.production.database.user></org.apache.jetspeed.production.database.user>
<org.apache.jetspeed.production.database.password></org.apache.jetspeed.production.database.password>
-->
</properties>
 4、配置 Jetspeed Maven插件
 
 
Maven 有一个全局的配置文件:settings.xml,它位于你的用户主目录下的 .m2 目录.在window上为: %USERPROFILE%\.m2\settings.xml . 如果该文件不存在你的系统上,你可以自己创建它,和复制粘贴下面的代码到你的xml里面。如果,已经存在了,为jetspeed增加pluginGroup 配置信息。

<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
<pluginGroup>org.apache.portals.jetspeed-2</pluginGroup>
</pluginGroups>
<!-- There might be more configuration here -->
</settings>


5、构建和部署我们的jetexpress门户
  通过dos界面进入到jetexpress的根目录;
  如下:C:\Documents and Settings\Administrator>cd jetexpress

C:\Documents and Settings\Administrator\jetexpress>mvn jetspeed:mvn -Dtarget=all

 接着输入:mvn jetspeed:mvn -Dtarget=all,回车,  显示如下信息: Failed to execute:    DROP TABLE PARAMETER

。。。。。省略一部分信息
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
ARAMETER' because it does not exist.
Failed to execute:    DROP TABLE PORTLET_SUPPORTS
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
ORTLET_SUPPORTS' because it does not exist.
Failed to execute:    DROP TABLE LANGUAGE
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'L
ANGUAGE' because it does not exist.
Failed to execute:    DROP TABLE PD_METADATA_FIELDS
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
D_METADATA_FIELDS' because it does not exist.
Failed to execute:    DROP TABLE PA_METADATA_FIELDS
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
A_METADATA_FIELDS' because it does not exist.
Failed to execute:    DROP TABLE PORTLET_APPLICATION
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
ORTLET_APPLICATION' because it does not exist.
Failed to execute:    DROP TABLE PORTLET_DEFINITION
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
ORTLET_DEFINITION' because it does not exist.
Failed to execute:    DROP TABLE OJB_DMAP
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'O
JB_DMAP' because it does not exist.
Failed to execute:    DROP TABLE OJB_DSET_ENTRIES
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'O
JB_DSET_ENTRIES' because it does not exist.
Failed to execute:    DROP TABLE OJB_DSET
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'O
JB_DSET' because it does not exist.
Failed to execute:    DROP TABLE OJB_DLIST_ENTRIES
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'O
JB_DLIST_ENTRIES' because it does not exist.
Failed to execute:    DROP TABLE OJB_DLIST
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'O
JB_DLIST' because it does not exist.
Failed to execute:    DROP TABLE OJB_NRM
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'O
JB_NRM' because it does not exist.
Failed to execute:    DROP TABLE OJB_LOCKENTRY
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'O
JB_LOCKENTRY' because it does not exist.
Failed to execute:    DROP TABLE OJB_HL_SEQ
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'O
JB_HL_SEQ' because it does not exist.
Failed to execute:    DROP TABLE CLUBS
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'C
LUBS' because it does not exist.
Failed to execute:    DROP TABLE PROFILE_PAGE_ASSOC
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
ROFILE_PAGE_ASSOC' because it does not exist.
Failed to execute:    DROP TABLE PRINCIPAL_RULE_ASSOC
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
RINCIPAL_RULE_ASSOC' because it does not exist.
Failed to execute:    DROP TABLE RULE_CRITERION
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'R
ULE_CRITERION' because it does not exist.
Failed to execute:    DROP TABLE PROFILING_RULE
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
ROFILING_RULE' because it does not exist.
Failed to execute:    DROP TABLE PAGE_SEC_CONSTRAINTS_REF
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_SEC_CONSTRAINTS_REF' because it does not exist.
Failed to execute:    DROP TABLE PAGE_SEC_CONSTRAINT_DEF
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_SEC_CONSTRAINT_DEF' because it does not exist.
Failed to execute:    DROP TABLE PAGE_SEC_CONSTRAINTS_DEF
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_SEC_CONSTRAINTS_DEF' because it does not exist.
Failed to execute:    DROP TABLE PAGE_SECURITY
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_SECURITY' because it does not exist.
Failed to execute:    DROP TABLE LINK_CONSTRAINTS_REF
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'L
INK_CONSTRAINTS_REF' because it does not exist.
Failed to execute:    DROP TABLE LINK_CONSTRAINT
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'L
INK_CONSTRAINT' because it does not exist.
Failed to execute:    DROP TABLE LINK_METADATA
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'L
INK_METADATA' because it does not exist.
Failed to execute:    DROP TABLE LINK
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'L
INK' because it does not exist.
Failed to execute:    DROP TABLE FRAGMENT_PROP
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
RAGMENT_PROP' because it does not exist.
Failed to execute:    DROP TABLE FRAGMENT_PREF_VALUE
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
RAGMENT_PREF_VALUE' because it does not exist.
Failed to execute:    DROP TABLE FRAGMENT_PREF
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
RAGMENT_PREF' because it does not exist.
Failed to execute:    DROP TABLE FRAGMENT_CONSTRAINTS_REF
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
RAGMENT_CONSTRAINTS_REF' because it does not exist.
Failed to execute:    DROP TABLE FRAGMENT_CONSTRAINT
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
RAGMENT_CONSTRAINT' because it does not exist.
Failed to execute:    DROP TABLE FRAGMENT
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
RAGMENT' because it does not exist.
Failed to execute:    DROP TABLE PAGE_MENU_METADATA
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_MENU_METADATA' because it does not exist.
Failed to execute:    DROP TABLE PAGE_MENU
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_MENU' because it does not exist.
Failed to execute:    DROP TABLE PAGE_CONSTRAINTS_REF
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_CONSTRAINTS_REF' because it does not exist.
Failed to execute:    DROP TABLE PAGE_CONSTRAINT
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_CONSTRAINT' because it does not exist.
Failed to execute:    DROP TABLE PAGE_METADATA
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_METADATA' because it does not exist.
Failed to execute:    DROP TABLE PAGE
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE' because it does not exist.
Failed to execute:    DROP TABLE FOLDER_MENU_METADATA
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
OLDER_MENU_METADATA' because it does not exist.
Failed to execute:    DROP TABLE FOLDER_MENU
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
OLDER_MENU' because it does not exist.
Failed to execute:    DROP TABLE FOLDER_ORDER
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
OLDER_ORDER' because it does not exist.
Failed to execute:    DROP TABLE FOLDER_CONSTRAINTS_REF
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
OLDER_CONSTRAINTS_REF' because it does not exist.
Failed to execute:    DROP TABLE FOLDER_CONSTRAINT
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
OLDER_CONSTRAINT' because it does not exist.
Failed to execute:    DROP TABLE FOLDER_METADATA
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
OLDER_METADATA' because it does not exist.
Failed to execute:    DROP TABLE FOLDER
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'F
OLDER' because it does not exist.
Failed to execute:    DROP TABLE USER_ACTIVITY
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'U
SER_ACTIVITY' because it does not exist.
Failed to execute:    DROP TABLE ADMIN_ACTIVITY
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'A
DMIN_ACTIVITY' because it does not exist.
Failed to execute:    DROP TABLE USER_STATISTICS
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'U
SER_STATISTICS' because it does not exist.
Failed to execute:    DROP TABLE PAGE_STATISTICS
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
AGE_STATISTICS' because it does not exist.
Failed to execute:    DROP TABLE PORTLET_STATISTICS
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'P
ORTLET_STATISTICS' because it does not exist.
Failed to execute:    DROP TABLE MEDIATYPE_TO_MIMETYPE
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'M
EDIATYPE_TO_MIMETYPE' because it does not exist.
Failed to execute:    DROP TABLE MEDIATYPE_TO_CAPABILITY
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'M
EDIATYPE_TO_CAPABILITY' because it does not exist.
Failed to execute:    DROP TABLE CLIENT_TO_MIMETYPE
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'C
LIENT_TO_MIMETYPE' because it does not exist.
Failed to execute:    DROP TABLE CLIENT_TO_CAPABILITY
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'C
LIENT_TO_CAPABILITY' because it does not exist.
Failed to execute:    DROP TABLE CAPABILITY
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'C
APABILITY' because it does not exist.
Failed to execute:    DROP TABLE MIMETYPE
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'M
IMETYPE' because it does not exist.
Failed to execute:    DROP TABLE CLIENT
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'C
LIENT' because it does not exist.
Failed to execute:    DROP TABLE MEDIA_TYPE
java.sql.SQLSyntaxErrorException: 'DROP TABLE' cannot be performed on 'M
EDIA_TYPE' because it does not exist.
Executing SQL script file: C:\Documents and Settings\Administrator\jetexp
ress\jetexpress-portal\target\ddl\derby\create-schema.sql

log4j:WARN No appenders could be found for logger (org.apache.jetspeed.component
s.JetspeedBeanDefinitionFilter).
log4j:WARN Please initialize the log4j system properly.
creating clients, mediatypes and mimetypes
creating principals and permissions
creating permissions
creating profiling rules and user profiling rules
creating entities
creating SSO sites, principals, and security domains
------------------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 1 minute 5 seconds
Finished at: Fri Oct 29 15:30:07 CST 2010
Final Memory: 25M/45M
------------------------------------------------------------------------
...SUCCESS.
Executing target: db dependent on ONLY: all done
Executing target: deploy-portal dependent on
Invoking target deploy-portal: C:\Documents and Settings\Administrator\je
texpress\jetexpress-portal\jetspeed-mvn-portal-pom.xml deploy
+ Error stacktraces are turned on.
Scanning for projects...
------------------------------------------------------------------------
Building Jetspeed-2 Maven Invoker Configuration for My Portal
    task-segment:
------------------------------------------------------------------------


File encoding has not been set, using platform encoding GBK, i.e. buil
d is platform dependent!
Using platform encoding (GBK actually) to copy filtered resources, i.e
. build is platform dependent!
skip non existing resourceDirectory C:\Documents and Settings\Administrat
or\jetexpress\jetexpress-portal\src\conf
Copying 1 resource to ../resources
While downloading xml-apis:xml-apis:2.0.2
This artifact has been relocated to xml-apis:xml-apis:1.0.b2.


Deploying to targetBaseDir C:\change\this\apache-tomcat-6.0.18
   deploying to lib: portlet-api_2.0_spec-1.0.jar
   deploying to lib: ccpp-1.0.jar
   deploying to lib: jetspeed-api-2.2.1.jar
   deploying to lib: jetspeed-commons-2.2.1.jar
   deploying to lib: pluto-container-api-2.0.0.jar
   deploying to lib: pluto-taglib-2.0.0.jar
   deploying to lib: portals-bridges-common-2.0.jar
   deploying to system: derby-10.3.2.1.jar
   deploying to war: jetexpress (expanded)
   deploying to context: jetexpress.xml
   deploying to war: j2-admin.war
   deploying to server-lib: apa-logging-1.0.jar
------------------------------------------------------------------------
BUILD ERROR
------------------------------------------------------------------------
Cannot find, read, or write target file to edit: \change\this\apache-tomc
at-6.0.18\conf\server.xml
------------------------------------------------------------------------
Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot find, read, or wr
ite target file to edit: \change\this\apache-tomcat-6.0.18\conf\server.xml
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot find, read, or
write target file to edit: \change\this\apache-tomcat-6.0.18\conf\server.xml
at org.apache.jetspeed.maven.plugins.DeployMojo.execute(DeployMojo.java:
572)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
... 17 more
------------------------------------------------------------------------
Total time: 5 seconds
Finished at: Fri Oct 29 15:30:13 CST 2010
Final Memory: 10M/19M
------------------------------------------------------------------------
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
...FAILED.
------------------------------------------------------------------------
For more information, run Maven with the -e switch
------------------------------------------------------------------------
Total time: 1 minute 47 seconds
Finished at: Fri Oct 29 15:30:14 CST 2010
Final Memory: 6M/11M
------------------------------------------------------------------------
C:\Documents and Settings\Administrator\jetexpress>
 

  编译出错,从错位信息看,可能是数据库没创建之类导致的,那么我们可以到这个目录:
  C:\Documents and Settings\Administrator\jetexpress\jetexpress-portal\target\dll,里面生成了两个脚本,
  但发现是derby数据库脚本,我们是用mysql 的,那么我们先在mysql创建数据库jetspeed,然后和创建表,再重新编译部署。

mysql> create database jetspeed;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database         |
+--------------------+
| information_schema |
| demo               |
| jetspeed         |
| light            |
| mysql            |
| phpmyadmin         |
| tera_wurfl_demo    |
| test               |
| wurfl            |
+--------------------+
9 rows in set (0.00 sec)
  把以下表的脚本,在mysql执行;

未完,内容太多,放不下,续二
  


 http://inotgaoshou.iteye.com/blog/797735
页: [1]
查看完整版本: 利用maven部署apache的jetspeed门户一