- First, download Seam Forge from here
- Unzip to a folder of your choosing
- Run bin\forge
[no project] forge-1.0.0.Alpha2 $ new-project --named MyApp --topLevelPackage com.myapp
Use [/forge-1.0.0.Alpha2/MyApp] as project directory? [Y/n] y
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/resources/META-INF/forge.xml
***SUCCESS*** Created project [MyApp] in new working directory [/forge-1.0.0.Alpha2/MyApp]
[MyApp] MyApp $ persistence setup --provider HIBERNATE --container JBOSS_6
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/resources/META-INF/persistence.xml
***SUCCESS*** Installed [forge.spec.jpa] successfully.
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/resources/META-INF/persistence.xml
[MyApp] MyApp $ new-entity --named Person
In which package you'd like to create this @Entity, or enter for default: [com.myapp.domain]
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/domain/Person.java
Created @Entity [com.myapp.domain.Person]
Picked up type: com.myapp.domain.Person
[MyApp] Person.java $ new-field string --fieldName firstName
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/domain/Person.java
Added field to com.myapp.domain.Person: @Column private String firstName;
[MyApp] Person.java $ new-field string --fieldName surname
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/domain/Person.java
Added field to com.myapp.domain.Person: @Column private String surname;
[MyApp] Person.java $ cd ..
[MyApp] domain $ scaffold from-entity com.myapp.domain.Person.java
The [forge.maven.WebResourceFacet] facet requires the following packaging type [war], but is currently [jar], would you like to change the packaging to [war]? (Note: this could break other plugins in your project.) [Y/n] y
Packaging updated to [war]
***SUCCESS*** Installed [forge.maven.WebResourceFacet] successfully.
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/WEB-INF/beans.xml
***SUCCESS*** Installed [forge.spec.cdi] successfully.
The [forge.spec.jsf] facet depends on the following missing facets: [forge.spec.servlet]. Would you like to attempt installation of these facets as well? [Y/n] y
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/WEB-INF/web.xml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/index.html
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/WEB-INF/faces-config.xml
***SUCCESS*** Installed [forge.spec.jsf] successfully.
***SUCCESS*** Scaffolding installed.
No scaffold type was provided, use Forge default? [Y/n] y
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/WEB-INF/beans.xml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/org/jboss/seam/forge/persistence/DatasourceProducer.java
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/org/jboss/seam/forge/persistence/PersistenceUtil.java
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/resources/forge-template.xhtml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/resources/forge.css
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/resources/favicon.ico
***INFO*** [/forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/domain/Person.java] File exists, re-run with `--overwrite` to replace existing files.
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/view/PersonBean.java
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/scaffold/person/view.xhtml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/scaffold/person/create.xhtml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/scaffold/person/list.xhtml
***SUCCESS*** Generated UI for [com.myapp.domain.Person]
Use [/forge-1.0.0.Alpha2/MyApp] as project directory? [Y/n] y
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/resources/META-INF/forge.xml
***SUCCESS*** Created project [MyApp] in new working directory [/forge-1.0.0.Alpha2/MyApp]
[MyApp] MyApp $ persistence setup --provider HIBERNATE --container JBOSS_6
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/resources/META-INF/persistence.xml
***SUCCESS*** Installed [forge.spec.jpa] successfully.
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/resources/META-INF/persistence.xml
[MyApp] MyApp $ new-entity --named Person
In which package you'd like to create this @Entity, or enter for default: [com.myapp.domain]
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/domain/Person.java
Created @Entity [com.myapp.domain.Person]
Picked up type
[MyApp] Person.java $ new-field string --fieldName firstName
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/domain/Person.java
Added field to com.myapp.domain.Person: @Column private String firstName;
[MyApp] Person.java $ new-field string --fieldName surname
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/domain/Person.java
Added field to com.myapp.domain.Person: @Column private String surname;
[MyApp] Person.java $ cd ..
[MyApp] domain $ scaffold from-entity com.myapp.domain.Person.java
The [forge.maven.WebResourceFacet] facet requires the following packaging type [war], but is currently [jar], would you like to change the packaging to [war]? (Note: this could break other plugins in your project.) [Y/n] y
Packaging updated to [war]
***SUCCESS*** Installed [forge.maven.WebResourceFacet] successfully.
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/WEB-INF/beans.xml
***SUCCESS*** Installed [forge.spec.cdi] successfully.
The [forge.spec.jsf] facet depends on the following missing facets: [forge.spec.servlet]. Would you like to attempt installation of these facets as well? [Y/n] y
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/WEB-INF/web.xml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/index.html
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/WEB-INF/faces-config.xml
***SUCCESS*** Installed [forge.spec.jsf] successfully.
***SUCCESS*** Scaffolding installed.
No scaffold type was provided, use Forge default? [Y/n] y
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/WEB-INF/beans.xml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/org/jboss/seam/forge/persistence/DatasourceProducer.java
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/org/jboss/seam/forge/persistence/PersistenceUtil.java
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/resources/forge-template.xhtml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/resources/forge.css
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/resources/favicon.ico
***INFO*** [/forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/domain/Person.java] File exists, re-run with `--overwrite` to replace existing files.
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/java/com/myapp/view/PersonBean.java
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/scaffold/person/view.xhtml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/scaffold/person/create.xhtml
Wrote /forge-1.0.0.Alpha2/MyApp/src/main/webapp/scaffold/person/list.xhtml
***SUCCESS*** Generated UI for [com.myapp.domain.Person]
Next:
- Open Eclipse (with m2eclipse installed)
- Choose File > Import > Existing Maven Projects and import the pom.xml at \forge-1.0.0.Alpha2\MyApp\pom.xml
- Edit src/main/resources/META-INF/persistence.xml and remove the line that says <non-jta-data-source/> (a bug)
- Right click the pom.xml and choose Run As > Maven package
- Take the WAR it generates under target/MyApp-1.0.0-SNAPSHOT.war and deploy it under JBoss AS 6.0.0.Final
- Open your browser at http://localhost:8080/MyApp-1.0.0-SNAPSHOT/scaffold/person/list.jsf:
- Click Create:
3 comments:
Didnt work for me.. I got;
Caused by: java.sql.SQLException: Table not found in statement [insert into User]
at org.hsqldb.jdbc.Util.sqlException(Unknown Source) [:6.0.0.Final]
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source) [:6.0.0.Final]
at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source) [:6.0.0.Final]
at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:91) [:6.0.0.Final]
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:366) [:3.6.0.Final]
... 83 more
Any ideas ?
Seam Forge is still in alpha, so lots of things still need work. But I am not one of the developers.
You could try posting your question on http://seamframework.org/Community/Seam3Users.
Richard.
Looks pretty swifty. In similar vein to Rails and Rake commands. Definitely will keep this one on the radar. This kind of stuff is part of the reason Ruby on Rails led me away from mainstream Java dev in the first place. :)
Post a Comment