First go to https://struts.apache.org/download.cgi#struts2320 download struts source package,The version i downloaded is:Struts 2.3.20, after the download is complete, unzip caninstall MAVEN, a big push on the internet, do not say the installation method, then configure the MAVEN environment variable, open cmd, input mvn-versionIf the output is the following, then the installation configuration is successful:
apache maven 3.2.3 (33F8C3E1027C3DDDE99D3CDEBAD2656A31E8FDF4; 2014-08-12t04:58:10+08:00) maven Home:d:\ Program Files (x86) \maven3.2.3\bin\. Java version:1.7.0_05, vendor:oracle Corporationjava home:d:\program Files (x86) \java\jdk1.7.0_05\jredefault Locale:z H_CN, platform Encoding:gbkos name: "Windows NT (unknown)", Version: "6.2", Arch: "x86", Family: "Windows" |
After entering the path through CMD into struts decompression, my is: E:\struts-2.3.20-src\struts-2.3.20\src input mvn eclipse:eclipse, Will find that there is no BOM and archetypes Pom file, it does not matter, open the Pom file under SRC, find <modules> Comment out the two components as follows:
<modules> <!--<module>bom</module>--> <module>xwork-core</module> <module>core</module> <module>apps</module> <module>plugins</module> <module>bundles</module> <!--<module>archetypes</module>--> </modules> |
Run again,mvn Eclipse:eclipse also error, said apps under the Pom.xml didn't find Jboss-blank, open apps/pom.xml, notice the last Pom.xml is in E:\struts-2.3.20-src\ STRUTS-2.3.20\SRC path, do not mistake, this is two different pom files.
[ERROR] The build could not read 1 project---[Help 1] [ERROR] [ERROR] The Project org.apache.struts:struts2-apps:2.3.20 (E:\STRUTS-2.3.20-SR C\struts-2.3.20\src\apps\pom.xml) has 1 error [ERROR] Child Module E:\struts-2.3.20-src\struts-2.3.20\src\apps\jboss-blank Of E:\struts-2.3.20-src\struts-2.3.20\src\apps\pom.xml does not exist [ERROR] [ERROR] The full stack trace of the errors, re-run Maven with The-e Swit Ch. [ERROR] Re-run Maven using The-x switch to enable full debug logging. [ERROR] [ERROR] For more information on the errors and possible solutions, please REA D The following articles: [ERROR] [Help 1] Http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin Gexception |
The following comments are followed:
<modules> <module>blank</module> <!--<module>jboss-blank</module>--> <module>mailreader</module> <module>portlet</module> <module>showcase</ Module> <module>rest-showcase</module> </modules> |
Then, run it again:mvn eclipse:eclipseCompile, after more than six minutes, finally compiled successfully, the project can already be imported into eclipse. After the successful import into Eclipse, the following are:
Use MAVEN to compile struts2 source into Eclipse project