关于maven:91pom-相关的配置propertiesbuildrepositories

65次阅读

共计 1522 个字符,预计需要花费 4 分钟才能阅读完成。

属性配置:

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
    </properties>

build 插件配置:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

配置 maven 的库:

    <repositories>
        <repository>
            <id>public</id>
            <name>aliyun nexus</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>public</id>
            <name>aliyun nexus</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

maven 依赖指向本地:

 <dependency>
            <groupId>com.linewell</groupId>
            <artifactId>typp-frame-core</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/lib/typp-frame-core-0.0.1-SNAPSHOT.jar</systemPath>
        </dependency>

将本地 jar 包增加到 maven 仓库
语法:

mvn install:install-file -Dfile=jar 包的地位 (参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar

理论例子:

mvn install:install-file -Dfile=E:/res/jar_lib/ag777-1.0.jar -DgroupId=ag777 -DartifactId=ag777 -Dversion=1.0 -Dpackaging=jar

正文完
 0