1 thought on “How to solve AXIS2 corresponding to JAR's maven equipment”

  1. 1. Use the statement

    . This method is the same as other Maven. It is declared in POM.XML:

    /Groupid>
    u003C>
    u003Cvision> 1.0.0 u003C/version>
    u003Cscope> System u003C/scope>
    u003C> $ {project.basedir } /lib/jms.jar u003C/>
    u003C/>
    The careful people may have noticed it. There are two more statements here: scope and.

    . Create a library with a Project range
    The above method is to avoid the installation of LIB to the Maven library direction. Another method is to consider the direction of the constructor: create a virtual local library so that Maven can go to this local library to find the required lib.

    The steps are roughly as follows:
    1. Constructing a virtual Maven library

    The we need to provide a folder/file structure that is the same as the Maven library structure to simulate the Maven library For example, if the lib in Project is a Maven library, its structure may be:

    as above, the virtual library declares two jar:
    1. Com.mbm.mq 1.0 .jar: groupid is org.ibm.jms; it is com.ibm.mq; version is 1.0
    2. com.mqjms-1.0.jar: groupid is organ.ibm.jms; it is com.ibm.mqjms ; Version is 1.0

    I assuming that the above JAR is available for Maven dependencies, the adding items in the dependence are:
    /Groupid>
    u003C> com.ibm.mqjms u003C/>
    u003Cversion> 1.0 u003C/version>
    u003C/>
    u003C>
    u003Cu003Cu003Cu003Cu003Cu003Ciloupid> org> ORG .ibm.jms u003C/Groupid>
    u003C> com.ibm.mq u003C/>
    u003Cvision> 1.0 u003C/version>
    u003C/>
    n Below below The question is how to make Maven find this virtual Maven library.

    In pom.xml, we use the library of multiple Maven that may be found, for example:

    u003C>
    u003C>
    u003CRleases>
    u003Cenabled> false u003C/enabled>
    u003C> alway u003C/>
    u003C> warn u003C/> n u003C/regs>
    u003Csnapshots >
    u003Cenabled> true u003C/enabled>
    u003C> never u003C/>
    u003C/>
    u003C/snapshots>
    u003CID> u003C/ ID>
    u003Cname> codehaus snapshots u003C/name>
    u003Curl> Snapshots.maven.codehaus/maven2 u003C/url>
    u003Clayout> default>
    u003Cu003Cu003C/layout>
    u003Cu003Cu003Cu003C />
    u003C/>

    . When the Maven did not find the corresponding Artifact in the Central Curriculum, it would go to these libraries to find. Therefore, we only need to add the definition of the virtual Maven library to POM.XML:
    xml code collection code
    u003C>
    u003C>
    u003CID> repo u003C/ID>
    u003CRleases>
    u003Cenabled> True u003C/enabled>
    u003C> iGnore u003C/>
    u003C/releases>
    u003Csnapshots>
    u003Cenabled> false u003C/enabled>
    u003C/snapshots>
    u003Curl> file: // $ {project.basedir}/lib u003C/url>
    u003C/>
    u003C/>
    The path of the library here is: $ {project.basedir}/lib. It is a release library instead of the Snapshot library.

    Differential
    Methods 1: It will directly quote the lib of the specified path without adding it to the local Maven library, so it is only used in the current Project, but the project can be convenient to be convenient Share sharing, and do not use additional space
    Method two: The referenced jars will be installed to the local Maven Curry first, and then loaded from the local Maven Curry. Project can also be quoted, but it needs to be installed locally. The current project is portable, but the project that is directly quoted and not declared above may not be portable.

Leave a Comment

Shopping Cart