How to import struts source code into eclipse

Source: Internet
Author: User

The pre-conditions and spring source code are imported into Eclipse, and the steps to import eclipse are given below.

Steps:

1. Download the corresponding version of Struts source http://struts.apache.org/download.cgi. What I'm downloading here is struts-2.3.16-all.zip. Unzip to the local directory when the download is complete.

2. The source of struts is managed by MAVEN, so you need to download maven http://maven.apache.org/download.cgi. After completion, unzip to the local directory, and then configure the Maven_home, PATH environment variable. If configured correctly, enter in cmd: Mvn-v can display its version number correctly. Also need to modify the location of the local repository: Modify the%maven_home%/conf/settings.xml file, configure repository in the middle of settings:

1 settings xmlns= "http://maven.apache.org/SETTINGS/1.0.0"2 xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"3 xsi:schemalocation= "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" & gt;4   <!--localrepository5    | The path to the local repository maven would use to store artifacts.6    |7    | Default: ${user.home}/.m2/repository8 <localRepository>/path/to/local/repo</localRepository>9    -Ten     <localrepository>E:/maven/apache-maven-3.1.1/repositories</localrepository> One.........
settings.xml

This directory is actually the location of the local repository, which is where the subsequent packages downloaded through Maven are placed by default on that path.

3. Enter the SRC folder under the Struts source root path and you can see a pom file. In fact, we can open the console input directly at this time: mvn eclipse:eclipse to compile. However, after this will encounter the problem of compilation failure, the analysis found that actually need to comment out two places, one is the SRC folder in the Pom.xml file:

1 <Modules>2         <Module>Xwork-core</Module>3         <Module>Core</Module>4         <Module>Apps</Module>5         <Module>Plugins</Module>6        <!--comment out these two sub-modules -7         <!--<module>bundles</module>8 <module>archetypes</module> -9     </Modules>
Src/pom.xml

One is in Src/app/pom.xml:

1 <Modules>2         <Module>Blank</Module>3        <!--comment out this module -    4        <!--<module>jboss-blank</module> -5         <Module>Mailreader</Module>6         <Module>Portlet</Module>7         <Module>Showcase</Module>8         <Module>Rest-showcase</Module>9     </Modules>
Src/app/pom.xml

After commenting out, open the console input in the SRC directory: mvn eclipse:eclipse.

4. Eclipse needs to install the Maven plugin. You can search for Maven in Eclipse's help--->marketplace, and then install the following version:

After the installation is complete, open windows--->preferences, search maven, configure Instalations to Maven_home and user settings to maven_home/conf/ Settings.xml can:

4. After the compilation is complete, you can import it in Eclipse. In fact we only need to import: Core and Xwork-core two projects can be, other projects are not used.

Next, you can freely debug the struts source code.

How to import struts source code into eclipse

Related Article

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.