IT Staff

Blog về chuyên ngành IT

Hello Lift

leave a comment »

If you don’t have Apache Maven, you can use the following command to install it on ubuntu:

$ sudo apt-get install maven

After that, to create a simple lift’s project, you first run the following command to create a new hello world project:

$ mvn archetype:generate -U \
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank \
-DarchetypeVersion=1.0 \
-DgroupId=demo.helloworld \
-DartifactId=helloworld \
-Dversion=1.0-SNAPSHOT

Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/16/maven-plugins-16.pom

[INFO]
[INFO] ————————————————————————
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ————————————————————————
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] — maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom —
….
[INFO] Using property: groupId = demo.helloworld
[INFO] Using property: artifactId = helloworld
[INFO] Using property: version = 1.0-SNAPSHOT
[INFO] Using property: package = demo.helloworld
Confirm properties configuration:
groupId: demo.helloworld
artifactId: helloworld
version: 1.0-SNAPSHOT
package: demo.helloworld
Y: :

[INFO] —————————————————————————-
[INFO] Using following parameters for creating project from Old (1.x) Archetype: lift-archetype-blank:1.0
[INFO] —————————————————————————-
[INFO] Parameter: groupId, Value: demo.helloworld
[INFO] Parameter: packageName, Value: demo.helloworld
[INFO] Parameter: package, Value: demo.helloworld
[INFO] Parameter: artifactId, Value: helloworld
[INFO] Parameter: basedir, Value: /home/xavier/Code/workspace_scala/work
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: /home/xavier/Code/workspace_scala/work/helloworld
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 9:43.099s
[INFO] Finished at: Mon Apr 01 16:22:18 ICT 2013
[INFO] Final Memory: 7M/59M
[INFO] ————————————————————————

$ cd helloworld
$ mvn jetty:run

[INFO] Scanning for projects…
[WARNING]
[WARNING] Some problems were encountered while building the effective model for demo.helloworld:helloworld:war:1.0-SNAPSHOT
[WARNING] ‘build.plugins.plugin.version’ for org.mortbay.jetty:maven-jetty-plugin is missing. @ line 97, column 15
[WARNING] ‘build.plugins.plugin.version’ for net.sf.alchim:yuicompressor-maven-plugin is missing. @ line 105, column 15
[WARNING] ‘build.plugins.plugin.version’ for org.scala-tools:maven-scala-plugin is missing. @ line 82, column 15
[WARNING] ‘build.plugins.plugin.version’ for org.apache.maven.plugins:maven-eclipse-plugin is missing. @ line 119, column 15
[WARNING] ‘reporting.plugins.plugin.version’ for org.scala-tools:maven-scala-plugin is missing. @ line 143, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ————————————————————————
[INFO] Building helloworld 1.0-SNAPSHOT
[INFO] ————————————————————————
[INFO]
[INFO] >>> maven-jetty-plugin:6.1.26:run (default-cli) @ helloworld >>>
[INFO]
[INFO] — maven-resources-plugin:2.3:resources (default-resources) @ helloworld —
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] — yuicompressor-maven-plugin:0.7.1:compress (default) @ helloworld —
[INFO] nb warnings: 0, nb errors: 0
[INFO]
[INFO] — maven-compiler-plugin:2.0.2:compile (default-compile) @ helloworld —
[INFO] Nothing to compile – all classes are up to date
[INFO]
[INFO] — maven-scala-plugin:2.15.2:compile (default) @ helloworld —
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] /home/xavier/Code/workspace_scala/work/helloworld/src/main/scala:-1: info: compiling
[INFO] Compiling 2 source files to /home/xavier/Code/workspace_scala/work/helloworld/target/classes at 1364811982417
[INFO] prepare-compile in 0 s
[INFO] compile in 6 s
[INFO]
[INFO] — maven-resources-plugin:2.3:testResources (default-testResources) @ helloworld —
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] — maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ helloworld —
[INFO] Nothing to compile – all classes are up to date
[INFO]
[INFO] — maven-scala-plugin:2.15.2:testCompile (default) @ helloworld —
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] Nothing to compile – all classes are up to date
[INFO]
[INFO] <<< maven-jetty-plugin:6.1.26:run (default-cli) @ helloworld <<<
[INFO]
[INFO] — maven-jetty-plugin:6.1.26:run (default-cli) @ helloworld —
[INFO] Configuring Jetty for project: helloworld
[INFO] Webapp source directory = /home/xavier/Code/workspace_scala/work/helloworld/src/main/webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = /home/xavier/Code/workspace_scala/work/helloworld/target/classes
2013-04-01 17:26:31.944:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
[INFO] Context path = /
[INFO] Tmp directory = determined at runtime
[INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = /home/xavier/Code/workspace_scala/work/helloworld/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = /home/xavier/Code/workspace_scala/work/helloworld/src/main/webapp
[INFO] Starting jetty 6.1.26 …
2013-04-01 17:26:32.373:INFO::jetty-6.1.26
2013-04-01 17:26:32.840:INFO::No Transaction manager found – if your webapp requires one, please configure one.
2013-04-01 17:26:34.543:INFO::Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.

 

Screenshot from 2013-04-01 16:29:30

Written by Xavier

Tháng Tư 1, 2013 lúc 4:24 chiều

Gửi phản hồi

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Log Out / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Log Out / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Log Out / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Log Out / Thay đổi )

Connecting to %s

%d bloggers like this: