Maven2 (for appfuse) beginner

Source: Internet
Author: User
Abstract:
This article discusses how to set up the maven environment used by appfuse and briefly introduces Maven.
Based on the content of the article, we can see that this article mainly involves setting in the eclipse + candy + maven2 environment-translator
Maven2 (for appfuse) Getting started

Title:
[Original translation] maven2 (for appfuse) noviceGetting started
[Appfuse 2.0 documentation-7]

Abstract:
This article discusses how to set up the maven environment used by appfuse and briefly introduces Maven.
Based on the content of the article, we can see that this article mainly involves setting in the eclipse + candy + maven2 environment-translator

Author: added by Nathan Anderson, Last edited by Duncan jauncey on Jul 10,200 7
Translator: josonchen)
Http://www.chq.name
)
Http://www.hhrz.org
)
Date: 2007.10.30

English version: http://appfuse.org/display/APF/
Maven + for + newbies

Chinese version:

MavenGetting started

Added by Nathan Anderson, Last edited by Duncan jauncey on Jul 10,200 7
Like my experience in using appfuse 1.9.x, this page also intentionally records my use of Maven and appfuse 2. X experience in the use process, and gradually transition to Web application development.
The following is my introduction. I am the development director of Sum-ware, which means I want to ensure that other developers and network administrators have something to do, and I want to fill the gaps in my work.
Me
I used two different ways to learn appfuse 2.x. At work, I used Windows + Sun Java 1.6 + eclipse
In the 3.2 Environment, I developed a project with the "appfuse-Basic-struts" structure. At home, I developed another project using Ubuntu + Sun Java.
1.6 + eclipse 3.2 Environment (this project may have to switch to idea-who knows ).
This project is based on the "appfuse-modular-struts" architecture.
I like to use struts 2 (at least for the moment) because I think it is relatively simple. During my learning, I like to limit various factors of change to my own control.
Targets and goals

 
* The first thing I have noticed is the similarities and differences between Maven's "goals" and ant's "targets. Goals
It's cool because they are generic and can be used for all Maven projects, but targets is easier to describe, because they only exist in the build. xml file.
(More or less). In Maven 2, there is a good list of commonly used goals and their applications.
* When Maven is not used at the very beginning, I also want to say it is very easy.Getting started
. Once the preliminary installation is completed (it is not difficult to do it), I will run appfuse within 10 minutes, and most of the time is spent on maven download of dependent files (drinking coffee)
).

Integrated ide

* IntegrationAppfuse2
After. X, eclipse worked very well, but I still encountered some troubles:
O when creating my pojo, I had to spend time cleaning up the project so that eclipse could recognize annotations
O but when I run the m2_repo command for the project, the command also runs. I also saw the jar packages listed in the project, however, the problem about Annotation cannot be solved.
O finally, I had to manually add the m2_repo environment variable, and everything went fine.
* I didn't use appfuse 2.x on idea, but I heard it is better than eclipse.

Downloading dependency packages)

* This process is cool and weird ., during the download, I saw a lot of warning or error messages reported by Maven, But it is strange that everything works well. Below 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 are not available.
· List of artifacts without a source archive:
· O org. Apache. Struts: struts2-core: 2.0.6
· O 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: 2.3.8
· O org. Tuckey: urlrewrite: 2.5.2
·
· [Info]
· [Info]
· [Info] ------------------------------------------------------------------------
· [Info] reactor summary:
· [Info] ------------------------------------------------------------------------
· [Info] appfuse modular application ...... success [6.338 S]
· [Info] appfuse modular application-core ...... success [57.907 S]
· [Info] appfuse modular application-web (struts 2) ...... success [. 721 S]
· [Info] ------------------------------------------------------------------------
· [Info] ------------------------------------------------------------------------
· [Info] build successful
· [Info] ------------------------------------------------------------------------
· [Info] total time: 3 minutes 27 seconds
· [Info] finished at: Tue APR 03 22:05:12 PDT 2007
· [Info] final memory: 48 m/63 m
[Info] ------------------------------------------------------------------------
How can the struts2-core download fail, but I'm running "MVN jetty: Run-war" but some are normal? I don't know how it works...
Okay... I have nothing to say. I think it may be impossible to get the source code package, but my running package has been correctly downloaded. Maybe someone can see this and avoid similar problems.
A new project is generated.
I believe that the app in the new project will be automatically generated. java and apptest. java (and core in modular archtypes. java), but I don't know its purpose. Can someone help me?
Maven HTTP Proxy Server Settings
For example
If your LAN uses the HTTP Proxy Server to access the Internet (note that it is not the maven repository proxy (Repository
Proxy), there is a difference between the two), when running Maven, you will see the error message: 'error transferring file '.
The solution is to find the address and port of your proxy server and add it to the command in the format of-dproxyset = true.
-Dproxyhost = <your proxy server host address>-dproxyport = <proxy service port>
Note: If you attempt to connect multiple times, the maven repository will be automatically listed in the blacklist. 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.