First of all, thank the Blog Park Master Fangjins, see his blog earnings, in the next only in the master's doubts and learn from the completion of this article.
?? Like to be awarded to the fishing, do not like to be awarded to fish, in this spirit, only to have the courage to write this article, please the hands of the elegant guests mercy.
?? Previously with spring as long as in the pipe network download jar is OK, then one day, the evil spring official website suddenly said not to provide direct download, a bit, said only to provide maven and Gradle download, these two things, I have not used, so-complain ...
?? Program Ape is a stock stupidity peculiar, the problem throat, feel sure to take care of her. So there is today's ... After that, 10,000 words are omitted ...
?? Hope to help the people who meet the same difficulties, but also like to teach you a bit.
?? Anyway
?? First step: Download the latest version of the IDE to the Eclipse official website, the latest version has its own MAVEN plugin, do not ask why I do not have plug-in installation-also with the low version of Eclipse, you have the nerve to ask? There is a need for shrimp, Baidu.
?? Step two: Download maven on the website and install the configuration. This step generally will, Baidu a bit how to engage. I'll make up the time behind.
?? Part II: Building projects Download Spring
?? 1. Configure the central repository specified by the Maven plugin, open eclipse:e:\apache-maven-3.2.1\conf\settings.xml (corresponding to your MAVEN directory), modify the configuration file: <localrepository ></localRepository> Open this tab and add your own designated central repository, mine is:<localRepository>E:/maven/repository</localRepository>(Note: I do not use the default M2 directory, I created a new directory), all the downloaded jars in the future.
?? 2. Create a new MAVEN project
????? Select Other in Eclipse->new to find the MAVEN project type. Such as:
????
??? 3. Next, complete the project's group Id,artifact Id, such as:
????
The group ID here is the id,arifact ID of the large item. Just as there are many small items in a large project, the package can be empty and, if filled, will be the default. After filling, direct finish, our favorite button, hahaha, the project structure is as follows
?? 4. After the project has been completed, eclipse will need to be modified in order to add the important source folder, which is not a simple floder, which will be compiled. Add Src/main/java,src/test/resources,src/test/java directory. Make the catalog into a standard MAVEN structure. How does it work? Project Right-->build path-->configure build path--> tab SOURCE--->add floder button, add folders in the appropriate directory, save as:
?
?? 5. Next, change some configurations: Get the JDK for the project to use the local JDK; The project's character set is UTF-8; the final directory:
?? 6. Turn the project into a Web project, select the project's properties and choose Project Facets, such as:
Note that Java chooses its own JDK version, can apply directly, I love this operation, hey!
?? 7. Do not hurry to close the window, at this time, we in the deployment assembly this menu see as
??
Delete the directory where our project does not need to be deployed, click OK, hum, you know!
? 8. Download the latest version of spring with the official website, configure the Pom.xml file, the required configuration can be obtained from the official website, please do not Baidu configuration, boring!!! There are two ways to obtain: 1.maven Central warehouse: http://mvnrepository.com/?? 2.spring official website: http://projects.spring.io/spring-framework/. Which, in spring, gets the simplest, do you not see that large configuration text?
Copy directly to your pom.xml's <dependencies></dependencies> tag. Then change the <packaging>jar</packaging>, change the war to a jar, save it, and you'll see that the spring-context you need is added to your dependency package. The Pox.xml configuration is as follows:
Everyone found no, I gave not spring 4.0.5.RELEASE version, but 4.0.4, the egg hurts to tell you, but the 4.0.5 download failed, do not tangle. With the official website, there is an advantage, it has an example.
Look at the page that the spring website has just given, you copy it to the project, run it again. Haha: helloworld! Let the program fly for a while ~maven follow-up, do not know the first of their own research, time 2014-06-06 01:40