`
leon709
  • 浏览: 2685 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

采用seam2的工具创建seam工程

    博客分类:
  • seam
 
阅读更多

最近想玩玩seam,看到seam3都出来了,不过我还是下载了个jboss-seam-2.2.2.Final,比较2。后来用这个下载的目录中有个seam.bat,运行,结合各种命令就可以进行工程的创建修改等各种操作,从这方面看,seam简直就是一个开发工具。

我用seam工具程序创建一个工程,并发布,记录下来整个过程如下:

 


D:\tool\jboss-seam-2.2.2.Final>seam setup
SEAM_HOME: D:\tool\jboss-seam-2.2.2.Final
Using seam-gen sources from: D:\tool\jboss-seam-2.2.2.Final\seam-gen
Buildfile: D:\tool\jboss-seam-2.2.2.Final\seam-gen\build.xml

init:

setup:
     [echo] Welcome to seam-gen 2.2.2.Final :-)
     [echo] Answer each question or hit ENTER to accept the default (in brackets)
     [echo]
    [input] Enter the directory where you want the project to be created (should
 not contain spaces) [C:/Projects] [C:/Projects]
D:/MySeam
    [input] Enter your JBoss AS home directory [C:/Program Files/jboss-5.1.0.GA]
 [C:/Program Files/jboss-5.1.0.GA]
D:\servers\JBoss510
    [input] Enter your JBoss AS domain [default] [default]
default
    [input] Enter your GlassFish V2 or V3 home directory (Ignore if you aren't d
eploying to GlassFish) [C:/Program Files/glassfish-v2.1] [C:/Program Files/glass
fish-v2.1]

    [input] Enter your GlassFish domain (Ignore if you aren't deploying to Glass
Fish) [domain1] [domain1]

    [input] Enter the project name [myproject] [myproject]
mySeam1
     [echo] Accepted project name as: mySeam1
    [input] Do you want to use ICEfaces instead of RichFaces? [n] (y, [n])
n
    [input] skipping input as property icefaces.home.new has already been set.
    [input] Select a RichFaces skin [glassX] (blueSky, classic, darkX, deepMarin
e, DEFAULT, emeraldTown, [glassX], japanCherry, laguna, ruby, wine)
blueSky
    [input] Is this project deployed as an EAR (with EJB components) or a WAR (w
ith no EJB support)? [war] (ear, [war])
ear
    [input] Enter the base package name for your Java classes [com.mydomain.mySe
am1] [com.mydomain.mySeam1]
leon.seam.domain1
    [input] Enter the Java package name for your session beans [leon.seam.domain
1.action] [leon.seam.domain1.action]
leon.seam.domain1.action
    [input] Enter the Java package name for your entity beans [leon.seam.domain1
.model] [leon.seam.domain1.model]
leon.seam.domain1.model
    [input] Enter the Java package name for your test cases [leon.seam.domain1.t
est] [leon.seam.domain1.test]
leon.seam.domain1.test
    [input] What kind of database are you using? [hsql] ([hsql], mysql, derby, o
racle, postgres, mssql, db2, sybase, enterprisedb, h2)
mysql
    [input] Enter the filesystem path to the JDBC driver jar [] []
D:\jars\mysql-connector-java-5.0.5.jar
    [input] skipping input as property driver.license.jar.new has already been s
et.
    [input] Enter the Hibernate dialect for your database [org.hibernate.dialect
.MySQLDialect] [org.hibernate.dialect.MySQLDialect]
org.hibernate.dialect.MySQLDialect
    [input] Enter the JDBC driver class for your database [com.mysql.jdbc.Driver
] [com.mysql.jdbc.Driver]
com.mysql.jdbc.Driver
    [input] Enter the JDBC DataSource class for your database [com.mysql.jdbc.jd
bc2.optional.MysqlDataSource] [com.mysql.jdbc.jdbc2.optional.MysqlDataSource]
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
    [input] Enter the JDBC URL for your database [jdbc:mysql:///test] [jdbc:mysq
l:///test]
jdbc:mysql://localhost:3306/mydb1
    [input] Enter the database username [sa] [sa]
root
    [input] Enter the database password [] []
leonsu
    [input] skipping input as property hibernate.default_schema.entered has alre
ady been set.
    [input] Enter the database catalog name (Enter '-' to clear previous value)
[] []

    [input] Are you working with tables that already exist in the database? [n]
(y, [n])
y
    [input] Do you want to recreate the database tables and execute import.sql e
ach time you deploy? [n] (y, [n])
n
[propertyfile] Creating new property file: D:\tool\jboss-seam-2.2.2.Final\seam-g
en\build.properties
     [echo] Installing JDBC driver jar to JBoss AS
     [copy] Copying 1 file to D:\servers\JBoss510\server\default\lib

init:

init-properties:
     [echo] D:/servers/JBoss510

validate-workspace:

validate-project:

settings:
     [echo] JBoss AS home: D:/servers/JBoss510
     [echo] GlassFish home: C:/Program Files/glassfish-v2.1
     [echo] Project name: mySeam1
     [echo] Project location: D:/MySeam/mySeam1
     [echo] Project type: ear
     [echo] IceFaces: n
     [echo] Action package: leon.seam.domain1.action
     [echo] Model package: leon.seam.domain1.model
     [echo] Test package: leon.seam.domain1.test
     [echo] JDBC driver class: com.mysql.jdbc.Driver
     [echo] JDBC DataSource class: com.mysql.jdbc.jdbc2.optional.MysqlDataSource

     [echo] Hibernate dialect: org.hibernate.dialect.MySQLDialect
     [echo] JDBC URL: jdbc:mysql://localhost:3306/mydb1
     [echo] Database username: root
     [echo] Database password: leonsu
     [echo]
     [echo] Type 'seam create-project' to create the new project

BUILD SUCCESSFUL
Total time: 13 minutes 53 seconds

D:\tool\jboss-seam-2.2.2.Final>seam create-project
 ...
 ...
 ...
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms
     [copy] Copying 1 file to D:\tool\jboss-seam-2.2.2.Final\classes\poms

copyseam:

copyseamdependencies:

copyjbossembedded:

copy-icefaces-home:

copy-icefaces-maven:

copy-lib:
     [echo] Copying Seam and dependencies to the D:/MySeam/mySeam1/lib directory
...
     [copy] Copying 152 files to D:\MySeam\mySeam1\lib
     [copy] Copied 5 empty directories to 2 empty directories under D:\MySeam\my
Seam1\lib
     [echo] Copying JBoss Embedded configuration to the D:/MySeam/mySeam1/bootst
rap directory...
     [copy] Copying 30 files to D:\MySeam\mySeam1\bootstrap

file-copy-war:

file-copy-ear:
     [echo] Copying build scripts for EAR deployment to the D:/MySeam/mySeam1 di
rectory...
     [copy] Copying 2 files to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [echo] Copying resources needed for EAR deployment to the D:/MySeam/mySeam1
/resources directory...
     [copy] Copying 8 files to D:\MySeam\mySeam1\resources

setup-filters:

file-copy:
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [copy] Copying 3 files to D:\MySeam\mySeam1\resources
     [copy] Copying 11 files to D:\MySeam\mySeam1\resources
     [copy] Copying 4 files to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1\.settings
     [copy] Copying 1 file to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
    [mkdir] Created dir: D:\MySeam\mySeam1\nbproject
     [copy] Copying 3 files to D:\MySeam\mySeam1\nbproject
     [copy] Copying 1 file to D:\MySeam\mySeam1\resources
     [copy] Copying 1 file to D:\MySeam\mySeam1\resources
     [copy] Copying 1 file to D:\MySeam\mySeam1\resources
     [copy] Copying 1 file to D:\MySeam\mySeam1\resources
     [copy] Copying 1 file to D:\MySeam\mySeam1\resources
     [copy] Copying 1 file to D:\MySeam\mySeam1\resources
     [copy] Copying 1 file to D:\MySeam\mySeam1\resources
     [copy] Copying 1 file to D:\MySeam\mySeam1\resources
     [copy] Copying 13 files to D:\MySeam\mySeam1\view
     [copy] Copying 16 files to D:\MySeam\mySeam1\view
     [copy] Copying 1 file to D:\MySeam\mySeam1\src\hot\leon\seam\domain1\action

     [copy] Copying 1 file to D:\MySeam\mySeam1\src\hot\leon\seam\domain1\action

     [copy] Copying 3 files to D:\MySeam\mySeam1
     [copy] Copying 1 file to D:\MySeam\mySeam1
    [mkdir] Created dir: D:\MySeam\mySeam1\src\main\leon\seam\domain1\model
    [mkdir] Created dir: D:\MySeam\mySeam1\src\test\leon\seam\domain1\test
     [copy] Copying 1 file to D:\MySeam\mySeam1\src\test

create-project:
     [echo] A new Seam project named 'mySeam1' was created in the D:/MySeam dire
ctory
     [echo] Type 'seam explode' and go to http://localhost:8080/mySeam1
     [echo] Eclipse Users: Import the project using File > Import... > Existing
Projects into Workspace, set the root directory to D:/MySeam, then select the pr
oject named mySeam1
     [echo] NetBeans Users: Open the project using File > Open project... and se
lect the project folder D:/MySeam/mySeam1
     [echo] IDEA Users: Open the project using File > Open project... and select
 the file D:/MySeam/mySeam1/mySeam1.ipr

BUILD SUCCESSFUL
Total time: 21 seconds

D:\tool\jboss-seam-2.2.2.Final>seam explode
SEAM_HOME: D:\tool\jboss-seam-2.2.2.Final
Using seam-gen sources from: D:\tool\jboss-seam-2.2.2.Final\seam-gen
Buildfile: D:\tool\jboss-seam-2.2.2.Final\seam-gen\build.xml

init:

init-properties:
     [echo] D:/servers/JBoss510

validate-workspace:

validate-project:

explode:
     [echo] Deploying project 'mySeam1' to JBoss AS as an exploded directory

init:
    [mkdir] Created dir: D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\mySeam1
_jar
    [mkdir] Created dir: D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\mySeam1
_war
    [mkdir] Created dir: D:\MySeam\mySeam1\dist

groovy.compile:

groovy.copy:

compile:
    [javac] Compiling 2 source files to D:\MySeam\mySeam1\exploded-archives\mySe
am1.ear\mySeam1_jar

copyclasses:
jar:
     [copy] Copying 2 files to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\m
ySeam1_jar
     [copy] Copying 2 files to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\m
ySeam1_jar\META-INF
     [copy] Copying 1 file to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\my
Seam1_jar\META-INF
     [copy] Copying 1 file to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\my
Seam1_jar

war:
     [copy] Copying 29 files to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\
mySeam1_war
     [copy] Copying 1 file to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\my
Seam1_war\WEB-INF\classes
     [copy] Copying 3 files to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\m
ySeam1_war\WEB-INF
     [copy] Copying 14 files to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\
mySeam1_war\WEB-INF\lib
     [copy] Copying 7 files to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\m
ySeam1_war\WEB-INF\classes
     [copy] Copying 1 file to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\my
Seam1_war\WEB-INF

ear:
     [copy] Copying 1 file to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear
     [copy] Copying 15 files to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\
lib
     [copy] Copying 2 files to D:\MySeam\mySeam1\exploded-archives\mySeam1.ear\M
ETA-INF

stage:

datasource:
     [copy] Copying 1 file to D:\servers\JBoss510\server\default\deploy

explode:
     [copy] Copying 18 files to D:\servers\JBoss510\server\default\deploy\mySeam
1.ear
     [copy] Copying 8 files to D:\servers\JBoss510\server\default\deploy\mySeam1
.ear\mySeam1.jar
     [copy] Copying 55 files to D:\servers\JBoss510\server\default\deploy\mySeam
1.ear\mySeam1.war

BUILD SUCCESSFUL
Total time: 5 seconds

D:\tool\jboss-seam-2.2.2.Final>

 运用到seam的三个命令:setup, project-generate, explode

setup阶段,[input]会提示输入各种参数,一步步填给它就好了

填完了以后,project-generate命令生成工程,explode命令发布到JBoss

运行JBoss,访问,发现很多生成的。

按照它的指示,我将工程导入到Eclipse,哇,发现生成的东西太多了。所有需要的包都给你导入了。整合了EJB3,JSF,Hibernate,配置JBosss Drools规则引擎等等。挺强大的。前台的页面也生成的不错,简洁好看。

剩下的工作就是根据你自己的需要修改项目咯。

开发环境的搭建都不需要了。变态……

0
1
分享到:
评论

相关推荐

    JBoss Seam工程的创建

    首先,为了开始创建Seam工程,你需要在你的开发环境中安装JBoss Seam框架。在本例中,假设你已经安装了JBoss AS(Application Server)和Eclipse IDE。一旦准备好这些基础环境,你可以按照以下步骤进行: 1. **配置...

    seam创建工程

    首先,创建Seam工程通常涉及以下步骤: 1. **环境准备**:确保你的开发环境中已经安装了Java JDK、Eclipse IDE(或其他支持Seam的IDE)、JBoss AS(或WildFly,因为Seam是基于JBoss的应用服务器)以及Seam工具集,...

    seam插件下载地址及安装过程

    安装完成后,重启 Eclipse,如果在工程空白处右键能看到创建 Seam 工程的选项,就说明安装成功。 接下来,需要下载并配置 JBoss 服务器。在这个例子中,我们使用的是 jboss-4.2.2.GA 版本。确保安装目录无空格和...

    Seam-gen生成基础项目骨架

    Seam-gen 是一款用于快速生成基于 Seam 框架的基础项目结构的工具,它通过简单的命令行交互式过程,帮助开发者构建项目的雏形,并且能够根据数据库信息自动生成管理数据库的 CRUD(Create, Read, Update, Delete)...

    Seam JBPM Eclipse工程例子

    "Seam JBPM Eclipse工程例子"很可能是通过Eclipse IDE创建的一个综合项目,其中`MyTodo-ear`可能是一个企业应用档案(EAR),它包含了整个应用程序的所有组件,如EJB和Web模块。`MyTodo`可能代表Web层,使用JSF来...

    seam 反向工程_没有实体生成

    在这个特定的场景中,“seam 反向工程_没有实体生成”可能指的是在使用Seam框架进行项目开发时,遇到了在反向工程过程中未自动生成实体类的问题。 在Java EE开发中,实体类(Entity Class)是用于映射数据库表的...

    seam_reference英文文档,讲解Seam更详细

    - **项目初始化**:通过seam-gen工具,指导用户如何创建一个新的Seam项目。 ##### 3. 创建动作 - **动作创建**:这部分介绍了如何使用Seam框架创建自定义的动作类。 ##### 4. 创建表单 - **表单与动作结合**:这...

    seam in action中文第一章

    在第二章,读者将学习如何使用Seam的项目生成工具快速创建应用,了解Seam项目的结构,以及如何自定义工程以适应开发流程。这一部分旨在帮助初学者快速入门,通过实际操作体验Seam的魅力。 总的来说,Seam in Action...

    seam-gen命令解析文档

    此命令利用Hibernate的反向工程工具生成JPA Entity类、Seam Entity Home以及Entity Query、JavaBean和Facelets视图(查看、查找、编辑)。 #### 四、总结 通过上述介绍可以看出,`seam-gen`命令为开发者提供了极大...

    seam2.0 中文文档

    - 通过逆向工程的方式,从现有的数据库结构自动生成Seam应用。 - **将应用部署为EAR**: - 将整个应用打包成EAR格式进行部署。 - **Seam与增量热部署**: - 讨论了如何在开发过程中实现实时更新。 - **在Jboss4.0下...

    jboss_seam.pdf

    EJB3.0规范的引入,通过Java EE5中的注解工具和基于Hibernate的对象关系映射(ORM)模型,以及引入依赖注入(Inversion of Control, IoC)、面向切面编程(Aspect-Oriented Programming, AOP)等现代软件工程理念,...

    JBoss encore 工程和 JUnit测试自动生成工具2

    【JBoss encore工程与JUnit测试自动生成工具2详解】 在软件开发过程中,高效和便捷的开发工具对于提高生产力至关重要。JBoss encore是一个强大的框架,它为Java开发者提供了丰富的功能,加速了企业级应用的开发。本...

    JBoss encore 工程和 JUnit测试自动生成工具

    Encore提供了自动化工程创建和管理的功能,可以帮助开发者快速搭建基于JBoss技术栈的项目,如Seam和Weld框架。在本文中,我们将深入探讨JBoss Encore、JUnit测试以及与之相关的其他技术。 首先,让我们了解一下...

    JBoss Seam Tutorial

    在IT领域,JBoss Seam框架是企业级应用开发中的一个重要工具,它提供了丰富的组件和功能,使得Java EE应用程序的开发变得更加高效和灵活。本篇教程将深入解析如何整合Seam与Eclipse,以及如何配置Oracle数据库连接,...

    中山永丰实验学校SEAM创新实验室整体项目解决方案.doc

    中山永丰实验学校的SEAM创新实验室整体项目解决方案旨在打造一个集科学(Science)、工程(Engineering)、艺术(Art)、数学(Mathematics)于一体的教育环境,以促进学生综合素质的提升和创新能力的培养。...

    JBoss encore 工程7.31

    2. **快速开发**: Encore强调快速开发,这主要体现在它提供的各种预配置模板和自动化工具上。开发者可以快速搭建应用结构,无需从零开始编写大量基础代码,从而将更多精力集中在业务逻辑上。此外,Encore的热部署...

    JBoss encore 工程和maven仓库

    Encore提供了一套工具和库,使得开发者能够更高效地创建和管理Java EE应用程序,尤其在Web和企业服务领域。这个框架集成了多个关键组件,包括Seam和Weld,它们都是Java EE生态中的重要部分。 Seam是一个全栈的Java ...

    seam-carving.rar_图形图像处理_Visual_C++_

    总的来说,"seam carving.rar"提供的是一套用Visual C++实现的图像处理工具,专注于利用seam carving算法进行无损图像尺寸调整。这个项目不仅展示了图像处理的高级技巧,也为学习者提供了深入理解和实践C++编程、...

    abaqus计算应力强度因子.doc

    在机械工程领域,应力强度因子(Stress Intensity Factor,SIF)是衡量裂纹尖端应力集中程度的重要参数,通常...在实际工程应用中,为了获得更精确的结果,通常需要调整模型尺寸和网格密度,以及采用更高级的裂纹模型。

Global site tag (gtag.js) - Google Analytics