Friday, July 26, 2013

Setup Skeleton Tapestry5 Project For Eclipse

For Tapestry5 Project, you need maven to be installed.
Once maven is installed, create a folder with project Name(eg:Sample)

Go to the command prompt and go to the folder you have created. Copy the below line into the command prompt and execute.

Download Skeleton Project

mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
Now
 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
$ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>>
[INFO] 
[INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<<
[INFO] 
[INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project)
2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Choose version: 
1: 5.0.19
2: 5.1.0.5
3: 5.2.6
4: 5.3.7
Choose a number: 4: 4
Define value for property 'groupId': : org.my.in
Define value for property 'artifactId': : sample
Define value for property 'version':  1.0-SNAPSHOT: : 
Define value for property 'package':  org.my.in: : org.my.in.sample
Confirm properties configuration:
groupId: org.my.in
artifactId: sample
version: 1.0-SNAPSHOT
package: com.example.tutorial
 Y: : 
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: quickstart:5.3.7
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.my.in
[INFO] Parameter: artifactId, Value: sample
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: org.my.in.sample
[INFO] Parameter: packageInPathFormat, Value: org/my/in/sample
[INFO] Parameter: package, Value: org.my.in.sample
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: org.my.in
[INFO] Parameter: artifactId, Value: sample
[WARNING] Don't override file /Users/user/workspace/tutorial1/src/test/java
[WARNING] Don't override file /Users/user/workspace/tutorial1/src/main/webapp
[WARNING] Don't override file /Users/user/workspace/tutorial1/src/main/resources/org/my/in/sample
[WARNING] Don't override file /Users/user/workspace/tutorial1/src/test/resources
[WARNING] Don't override file /Users/user/workspace/tutorial1/src/test/conf
[WARNING] Don't override file /Users/user/workspace/tutorial1/src/site
[INFO] project created from Archetype in dir: /Users/user/workspace/sample
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.398s
[INFO] Finished at: Fri Mar 1 11:46:08 PST 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------

Now the project is setup. You will see the folder structure like below.
 
Setup Project for Eclipse

Now to load the project into eclipse, execute the below command from the same folder

$ mvn eclipse:eclipse -DdownloadSources=true

This will start setting the project for eclipse.

1
2
3
4
5
6
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.1.1/maven-war-plugin-2.1.1.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.1.1/maven-war-plugin-2.1.1.pom (7 KB at 7.1 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.1.1/maven-war-plugin-2.1.1.jar
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.1.1/maven-war-plugin-2.1.1.jar (76 KB at 83.4 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/maven-metadata.xml

Import Project into Eclipse

Once it is fully completed, you need to import the project into your eclipse workspace. Go to Eclipse.File -> Import.

In the window select General -> Existing projects into workspace and select the project folder inside sample folder. Now the project is set up and ready for use.

No comments: