Come from:http://www.javaeye.com/topic/240424
With MAVEN, the required jar packs can no longer be found and downloaded as usual, using the IDE to get it done, Maven uses a project dependency (Dependency) concept, which, as the saying goes, is that my project needs to use your jar bag, Just call my project dependent on
element Systempath. Systempath will point to the path of the jar package on our system and must be the given absolute path. is as follows:
Øsystempath: It has been said that this element is used to specify the location of the dependent jar package on the system when the value of scope is systems, and is the absolute path. The element must be used when the scope of the dependent jar package is system, or MAVEN will complain.
Øoptional: Mark this
solve some of the problems that will arise when you use Maven to manage the life cycle of your application, the programming scenarios that occur.1. Executable JAR fileBuilding a jar file using Maven is easier: simply define the project as "Jar" and then execute the wrapper life cycle phase. But it is cumbersome to define an executable JAR file. Take the following steps to be more efficient:
The MA
Come from: http://www.javaeye.com/topic/240424
After Maven is used, the required jar package cannot be found and downloaded as usual. It is finished after IDE is imported. MAVEN uses a project dependency.As the saying goes, my project needs to use your jar package. In other words, your jar package is my project.Dependency.
So when Maven is just used, many peopl
Originally from: https://zeroturnaround.com/rebellabs/java-build-tools-how-dependency-management-works-with-maven-gradle-and-ant-ivy/ can run at compile time, problem at runtime In today's Java Project Automation building scenario, dependency Management has become a major part of the Project Building Automation tool, but it has always been the case in the past.
considered.
Easy to control the version of the jar package, and the dependencies of each jar package. For example, when you use the spring framework, you may find different versions of the development process, and when you need to modify the version, it takes time and effort to copy the jar package to Lib, and the version number is modified directly in Maven's Pom file, and maven will help you modify the jar
usually occurs when the POM reference is dependent and is not used at other times.
Maven argues that the dependencies of the program vary with the program's phase and application scenario, so the dependencies in Maven have scope (scope) limitations. In Maven, scope contains the following values:
Scope options
Compile (compi
Label:In the Java Web project, the inevitable use of the database, the following is the idea of adding MySQL dependency method. If you see this, it means you understand idea,maven and Tomcat, so ... Just add the dependencies in the Pom.xml, and here's my config file. XML version= "1.0" encoding= "UTF-8"?>
Projectxmlns= "http://maven.apache.org/POM/4.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
.
Easy to control the version of the jar package, and the dependencies of each jar package. For example, when you use the spring framework, you may find different versions of the development process, and when you need to modify the version, it takes time and effort to copy the jar package to Lib, and the version number is modified directly in Maven's Pom file, and maven will help you modify the jar dependency
1 Concept IntroductionAs we said before, MAVEN coordinates can determine a project. In other words, we can use it to resolve dependencies. In POM, dependencies are defined in the Dependencies section. In the above POM example, we define a dependency on JUnit with dependencies:[HTML]View PlainCopyPrint?
Dependencies >
Dependency >
groupId >junitgroupId>
In maven, by default, the dependent JAR package is not scored into the executable jar package, and if you need to break the dependency into the executable jar package, you need topomadded inmaven-assembly-pluginplug-ins, this is easy to implement, but it is not recommended in the formal development of such use, why? Because a slightly larger project has at least dozens of dependencies, each package will bre
Using maven in a Java project is great. It manages builds (as customized as you may need), executions, dependencies ... In fact, dependencies are, in my opinion, the key feature of Maven. Whenever a dependency is added to a project, MAVEN would search for it at repositories, download it and store it, tagging V Ersions.
version number of spring--also need to understand this very not intuitive fact, spring Security 3.1.x also does not rely on the spring 3.1.x version number ! This is because spring Security 3.1.x was announced prior to spring 3.1. Spring plans to keep these dependencies as consistent as possible in a future version number, and want to know a lot of other information to take a look at their Jira plan, but this is certainly not the case now, and we'll look at the details below.2.2. Spring-securit
IDEA cited MAVEN project jar package dependency import problem solution, mavenjar
IDEA has a built-in Maven environment. Maven is used by default to solve the project dependency problem. After a new project is created, the pom. xml file and the project name. iml file are ge
one, the dependence principle analysis
Jar Dependency Analysis: Maven's dependency management, using the nearest priority, order priority principle,
Maven dependency can be likened to a dependency tree, and the project itself can be considered a root node, as shown below
1,
one. Maven repository dependency mechanism MAVEN's library dependencies can help us automatically download dependent library files and update versions. Consider a situation to understand how the mechanism works, assuming that we want to use the LOG4J library as a log record of the project. Here's what we're going to do. 1. The traditional way 1) Visit log4j website http://logging.apache.org/log4j/2.x/ 2) Do
Original address: http://uule.iteye.com/blog/2087485Official API DescriptionDependency scope is used to limit the scope of Dependency, affecting the status of the package that the MAVEN project imports during each life cycle.Since 2.0.9, 1 new types have been added, and now there are 6 types of scopes:
CompileThe default scope, which means that dependency can
Problem descriptionDependencies are configured in Pom.xml, but the dependency is not successful, or the dependency is not found in the local warehouse The approximate error is as follows:Artifactdescriptorexception:failed to read artifact descriptor for Commons-beanutils:commons-beanutils-core:jar : 1.8.0:artifactresolutionexception:could not transfer artifact commons-beanutils:commons-beanutils-core:pom:1.
The program that has been developed Hadoop2.2.0 with Maven before. Environment changed to CDH5.2 after the error, found that Maven relies on the library problem. have been using http://mvnrepository.com/to find Maven dependencies before. But such sites can only find generic maven dependencies, not including CDH depende
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.