1, Common problems and Solutions
1. How to convert an ordinary project into a maven project in idea?
Right click add as maven project in idea to change a normal project into a maven project.
2. The maven dependency in idea is still displayed after being deleted. May it be due to cache problems?
3. How to avoid dependency conflict?
Every time you add dependencies, you should check whether there are jar package conflicts. It is recommended to install the plug-in maven helper (package dependency analysis and troubleshooting tool)
4.maven warehouse cannot normally obtain dependent packages?
Manually import -- run under the jar Directory:
MVN install: install file - dfile = path of jar package - Contents in DgroupId=gruopId - contents of dartifactid = actifacid - contents of Dversion=version - Dpackaging=jar
5. After the new version of the component is released, is the dependent party still pulling the old code?
Check whether the target warehouse has the same gav and other incorrect releases, and whether a certain level of warehouse fetches the old version cache, and then pull again after deleting the target package
You can also configure the remote package update and pull frequency and policy in maven configuration
1. The environment variable needs to correspond to the root directory of maven
2. To test mvn -v in cmd, you need to start cmd after configuration, similar to caching
3. Need to download network resources
4. By default, maven's local library points to: C: \ users \ admin \ m2\repository
5. When configuring LocalRepository, use '\' to translate: E:\envrionment\ali_repo
6. Configure Internet access
Note: Alibaba private server (agent = > Maven central database, private resources)
7. Resource positioning:
All maven related resources will have a unique central information segment to locate the resources;
It consists of three labels:
8.pom resource structure and significance
**. The jar package used by jar is the same as the jar package for custom manually imported projects
**. POM: the core management document of maven; All resources are transformed by maven
**. javadoc.jar: explanation of documents, APIs and resources
**. sources.jar: source package. You can import the source package to view the source code
**. sha1 hash calculation to judge packet loss
8. Which archetype to choose?
For different projects that need to be maintained, they are essentially jar resources. The purpose of creating and maintaining them according to maven is different
Create projects with different skeletons and call different jar packages to maintain different projects, for example:
quickstart defaults to a normal java project, and webapp is a web application. Corresponding skeleton files are required locally
Finally, a maven project was created in the designated workspace
9. Create a project in workspace and operate the project command in POM XML file location
10. Empty items
11. The navigator in eclipse displays the project directory by disk, which is used for pasting
12.jar package is a maven project developed by the human team; Dependencies can be passed between Maven projects
13.maven uses jar package label
14. Set the external warehouse address
<name>Alibaba cloud public warehouse</name>
15. When working together, others told us that their snapshot version had changed. When we want to update in time, we can mvn clean install -U force the update, or delete the corresponding version of the jar package to complete the download of the new version of the jar package
16. Define component publishing address
<!--version management :Define your project(git Warehouse location)-->
<!-- release plug-in unit -->
<!-- Define the to publish to the warehouse source and javadoc -->
17. Use < scope > to control the life cycle of dependency compilation, and use the < exclude > tag to exclude useless or conflicting dependencies