Maven learning small

xiaoxiao2021-03-06  46

I don't know how to learn Maven, I should say that I started learning Maven today. I found the Chinese message display in the process of learning (message displayed as? ??) and can't download and compile slow problems, I think I think If you are more in online, you can't say a problem. Let's talk about how to solve it. 1, prompt when executed? ? ? This problem is actually a Chinese issue. In Maven 1.0, it has already integrated the Chinese version of Huangdong in Maven 1.0, but there is a small mistake when integrating Chinese. Everyone goes to the Maven.jar file in% haven_home% / lib directory, there is a message file in "org / Apache / Maven / Messages" in this compressed file, which should be the ASCII encoding format. But the error stored in 1.0 is UFT-8 format. We can extract this file out to make it converted to the ASCII format after using Native2ASCII.exe with JDK to ASCII format. In this way, the problem of Chinese messages is solved! 2. About unable to connect to the remote Repository library for download and compile speed slower. In the default, the remote library of Maven is ibibio website. I don't know why this website is sealed in China! So I can't download, but we can use the Project.Properties file in each project, add such a line of maven.repo.remote = http://public.planetmirror.com/pub/maven, which represents this project The remote library can be downloaded by public.planetmirror.com/pub/maven. Of course, if we don't want each project to change, you can directly modify the defaults.properties file in Maven.jar, and modify it to the above. At the same time, we don't have to download every developer to the outside network. We can build a repository remote library website. For example, we use Window IIS, we only need to build a web in us. Directory, copy all of our directory under the reository folder below to this web directory. If we built this web directory, IIS virtual directory is http://192.168.1.1/maven/reppository, then we only need to set the developer's maven.repo.remote to http://192.168.1.1/maven/ Reppository is just fine, so that we have unified our JAR version, and I have a lot of developers to download what the files needed. At the same time, there is a reason for the compilation speed. There is a reason to download when compiling, and we need to check JAR version during the compilation process. For download jars, this action is just in the first time. Maven only check if there is the latest version of JAR if it is available. I want to check that the JAR version is necessary for a team's development!

Writing the last finally wants to say, I hope you will still be careful when you study! When I search on these issues today, most of the search came to say maven has these problems, but didn't say how to solve it, I think if everyone is careful, don't look at what is not serious. Just complaining, you will make this. It is the role of the open source project for us, and we can use it to improve our development efficiency. Two, we can learn, we can open the source code to learn how others are implemented, how others write procedures. In this way, when we encounter problems, we can better know the problem. Of course, for the actual, we don't need to see the source code of the open source project we need to see from the head to the end, most of which Based on interest and to solve the bug found in the open source project, it is enough, you will find that we will find that there are many problems in using a lot of open source projects, such as using maven Chinese issues, in fact it is a problem that many open source projects appear in Java internationalization. We have seen this solution, then if we have problems in other open source projects in the future, we only need to position the problem to this range. Today, I saw a lot of everyone about Maven, I was a little angry, I feel that there are some people who can solve the problem, and I can only say that China's IT industry is now. A large part of the people do not have a spirit of practical!

转载请注明原文地址:https://www.9cbs.com/read-115923.html

New Post(0)