This is the fourth day of my participation in the August More text Challenge. For details, see:August is more challenging
preface
You can’t write code until you’re fed
“Unable to inter base URL “is displayed when typing the address in the browser. “Unable to inter base URL” is displayed when typing the address. Today I’m going to document some of the maven-related issues I encountered while creating a SpringBoot project.
1. Gadget recommendations
To get started, a handy little tool is recommended: Everything; First of all, the file is very small, and secondly, its search function is very powerful. If you want to find a file, you can search directly to find the location of the file.
2. The introduction of dependency error
- Such as: org. Apache. Maven. Plugin. Surefire. SurefirePlugin NOT Found
2.1 Solution 1
- File -> Settings -> Build,Execution, Deployment -> Build Tools -> Maven set the contents of the Maven home path to the path you downloaded
It’s best to also put settings. XML in the default path of the User Settings file to avoid having to reconfigure every time!
Then click Maven to reload:
2.2 Solution 2
If method one doesn’t work, try Method two! The problem I encountered these two days is solved through this method! Is to explicitly declare a version number where the error occurred:
<version>2.222.</version>
Copy the code
To find the version number, go to Maven -> Plugins and find the corresponding item. For example, if the error is Maven-surfire-plugin, find the appropriate line for Surefire. The diagram below:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
Copy the code
Then reload Maven! This method is the one I use most at present, and it works every time!
2.3 Solution 3
If it doesn’t work, close the project and restart IDEA! After the project is loaded, configure Maven in Settings and then reload dependencies!
Use project integration tools
3.1 Integration Tools
Using some project integration tools, you can quickly build the required project, and select the configuration option to generate the code directly! Today we have seen the integration tool used by the company. The generated package includes the SpringBoot code directly, as well as the database code, with clear comments! The efficiency of writing code is greatly improved!
3.2 An Error is reported
- Such as:
Has the class com.example.demo0804.com mon. The constructor defined BaseEntity BaseEntity () like this kind of error, typically at compile time to see the prompt, Can according to the prompt to find the corresponding code to modify, not sure whether their own change is correct can first Baidu! You can also compile and read error messages. Sometimes it’s fun to read error messages, don’t you think? Click the prompt to jump to the error code and comment out the corresponding comment.