Maven2 (for AppFuse) beginner

Source: Internet
Author: User
Tags maven central
Summary:
This article discusses how to set up the MAVEN environment used by Appfuse and gives a brief introduction to Maven.
Based on the content of the article, you can see that this article is mainly about setting up in the ECLIPSE+CANDY+MAVEN2 environment-translator
Maven2 (for AppFuse) novice Getting Started

Title:
[Original translation] Maven2 (for AppFuse) novice Getting Started[AppFuse 2.0 Documentation-7]

Summary:
This article discusses how to set up the MAVEN environment used by Appfuse and gives a brief introduction to Maven.
Based on the content of the article, you can see that this article is mainly about setting up in the ECLIPSE+CANDY+MAVEN2 environment-translator

Author: Added by Nathan Anderson, last edited by Duncan Jauncey on Jul 10, 2007 06:04
Translated by: Chen Haiqing (Josonchen)
(Http://www.chq.name)
(http://www.hhrz.org)
Date: 2007.10.30

English version of the website: http://appfuse.org/display/APF/Maven+for+Newbies

Chinese version:


Maven Getting Started
Added by Nathan Anderson, last edited by Duncan Jauncey on Jul 10, 2007 06:04
As I have accumulated experience in the use of Appfuse 1.9.x, this page is also intended to record my experience in using MAVEN and Appfuse 2.x usage and to gradually transition to web application development.
Here is a little introduction to me. I am the development director of Sum-ware, which means I want to make sure that other developers and network managers are doing something, and I'm going to fill the gaps in my work.
I learned the Appfuse 2.x in two different ways. At work, I use the windows+ Sun Java 1.6 + ECLIPSE 3.2 environment to develop projects for the "appfuse-basic-struts" architecture. At home, I developed another project that uses Ubuntu +sun Java 1.6 +eclipse 3.2 environment (this project may have to switch to idea-who knows it). This project is based on the "appfuse-modular-struts" architecture.
I like to use Struts 2 (at least for now) because I think it's easier. During my studies I like to limit the various factors of change to the limits of what I can control.
Targets and goals

* The first thing I noticed was the similarities and differences between MAVEN's "goals" and Ant's "targets". Goals is cool because they are generic and can be used for all MAVEN projects, but targets is easier to describe because they exist only in build.xml files (more or less). In Maven 2 This article has a very good list of commonly used goals and their applications.
* When MAVEN is not used at first, I would also say it is very easy to Getting Started. Once the pre-installation is complete (not difficult to do), I've got appfuse running in 10 minutes, and most of the time is spent on Maven downloading dependent files (coffee time).

Integrating the IDE

* Integration AppFuse2. x, eclipse Workplace is fine, but I still have some trouble:
o When building my pojo, I had to spend time cleaning up the project so that eclipse could identify annotations
o But when I run a command for the project to build M2_repo and so on, the command also runs, and I see the list of dependent jar packages in the project, but it is impossible to solve the above problem about annotation.
o Finally, I had to add the M2_REPO environment variable manually, and then everything was fine.
* I didn't use Appfuse 2.x on idea, but I heard it was better than eclipse.

Download Dependency Pack (Dependency)

* The process is cool and weird. I saw Maven report a lot of warnings or error messages when I downloaded it, but it's strange that everything works well, here are some examples of output information:

· [INFO] Wrote Settings to/home/nathan/src/fetch-calendar/web/.settings/org.eclipse.jdt.core.prefs
· [INFO] Wrote Eclipse project for "Fetch-calendar-webapp" To/home/nathan/src/fetch-calendar/web.
· [INFO]
· Sources for some artifacts is not available.
· List of artifacts without a source archive:
· o org.apache.struts:struts2-core:2.0.6
· o commons-fileupload:commons-fileupload:1.1.1
· o opensymphony:clickstream:1.0.2
· o org.apache.struts:struts2-spring-plugin:2.0.6
· o velocity-tools:velocity-tools-view:1.0
· o javax.servlet:jsp-api:2.0
· o org.apache.struts:struts2-codebehind-plugin:2.0.6
· o freemarker:freemarker:2.3.8
· o org.tuckey:urlrewrite:2.5.2
·
· [INFO]
· [INFO]
· [INFO]------------------------------------------------------------------------
· [INFO] Reactor Summary:
· [INFO]------------------------------------------------------------------------
· [INFO] AppFuse Modular application .......... .......... SUCCESS [6.338s]
· [INFO] AppFuse Modular Application-core ............. SUCCESS [57.907s]
· [INFO] AppFuse Modular Application-web (Struts 2) ..... SUCCESS [2:20.721s]
· [INFO]------------------------------------------------------------------------
· [INFO]------------------------------------------------------------------------
· [INFO] BUILD Successful
· [INFO]------------------------------------------------------------------------
· [INFO] Total Time:3 minutes seconds
· [INFO] Finished At:tue Apr 22:05:12 PDT 2007
· [INFO] Final memory:48m/63m
[INFO]------------------------------------------------------------------------
How can struts2-core download failed, but I am running "mvn Jetty:run-war" but some normal? I do not know how to be good ...:?
All right... I'm not saying anything. I think it may not be possible to get the source package, but my run package is indeed downloaded correctly. Maybe someone can see this and avoid a similar problem.
The new project generates
I believe that the automatic generation of App.java and Apptest.java (and Core.java in modular archtypes) is really useful, but I do not know the purpose of it, can someone help me to answer it.
Maven's HTTP Proxy server settings
If your LAN uses an HTTP proxy server to surf the Internet (note that it is not a MAVEN warehouse agent (repository proxy), the two are different), running MAVEN will see an error message: ' Error transferring file '. The workaround is to find the address and port of your proxy server, added to the command, in the format:-dproxyset=true-dproxyhost=< your proxy server host address > Port of-dproxyport=< Proxy service >
Note: If you try to connect failed several times, then the MAVEN central repository will be automatically listed in the blacklist, and you can use the-u command line parameter to force the connection.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.