首页 > 其他分享 >spingboot maven 使用简化配置 将本地包加入classpath

spingboot maven 使用简化配置 将本地包加入classpath

时间:2023-06-06 14:56:32浏览次数:49  
标签:spingboot 0.0 boot maven pentaho spring org classpath 9.3

不是使用 dependencyManagement

 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.6.RELEASE</version>
        <relativePath/>
    </parent>

引入 systemPath

 <dependency>
            <groupId>org.pentaho</groupId>
            <artifactId>pentaho-encryption-support</artifactId>
            <version>9.3.0.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/pentaho-encryption-support-9.3.0.0-428.jar</systemPath>
        </dependency>

打包插件 注意需要将 systemPath 加入claspath

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring.boot.version}</version>
                <configuration>
                    <fork>true</fork>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>

完整简化配置pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sugon</groupId>
    <artifactId>dataExChangePlatform</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>dataExChangePlatform</name>
    <description>dataExChangePlatform</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <java.version>1.8</java.version>
        <mysql.version>8.0.31</mysql.version>
        <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.6.RELEASE</version>
        <relativePath/>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <version>${mysql.version}</version>
        </dependency>

        <dependency>
            <groupId>org.pentaho</groupId>
            <artifactId>kettle-core</artifactId>
            <version>9.3.0.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/kettle-core-9.3.0.0.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.pentaho</groupId>
            <artifactId>pentaho-engine</artifactId>
            <systemPath>${project.basedir}/src/main/resources/kettle-engine-9.3.0.0-428.jar</systemPath>
            <version>9.3.0.0</version>
            <scope>system</scope>
        </dependency>
        <dependency>
            <groupId>org.pentaho</groupId>
            <artifactId>pentaho-dbdialog</artifactId>
            <version>9.3.0.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/kettle-dbdialog-9.3.0.0-428.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.pentaho</groupId>
            <artifactId>pentaho-encryption-support</artifactId>
            <version>9.3.0.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/pentaho-encryption-support-9.3.0.0-428.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.pentaho</groupId>
            <artifactId>pentaho-xul-core</artifactId>
            <version>9.3.0.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/pentaho-xul-core-7.1.0.0-12.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.pentaho</groupId>
            <artifactId>metastore</artifactId>
            <version>9.3.0.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/metastore-9.3.0.0-428.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.oracle.jdbc</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.1.0.7.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/ojdbc6-11.1.0.7.0.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.oracle.jdbc</groupId>
            <artifactId>pentaho-xul-swt</artifactId>
            <version>7.1.0.0-12</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/pentaho-xul-swt-7.1.0.0-12.jar</systemPath>
        </dependency>


        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.67_noneautotype2</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
        </dependency>

        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>5.7.9</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
            <version>2.8.9</version>
        </dependency>



    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring.boot.version}</version>
                <configuration>
                    <fork>true</fork>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>aliyun</id>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>aliyun-plugin</id>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

标签:spingboot,0.0,boot,maven,pentaho,spring,org,classpath,9.3
From: https://www.cnblogs.com/guanchaoguo/p/17460528.html

相关文章

  • slf4j 和 log4j合用的(Maven)配置
    简述: 添加logger的日志输出,下面是配置信息供备忘  步骤:1.在Maven的porn.xml文件中添加dependency如下<dependency><groupId>org.slf4j</groupId><artifactId>slf4j-log4j12</artifactId><version>1.7.2</version></dependency>......
  • Maven(创建私有仓库和设置权限)
    为区分项目,要为项目建立私有仓库 1.添加仓库    2.填写私有仓库信息,然后保存 RiilRelease仓库 RiilSnapshot仓库   3.配置成功 4.添加权限    5.添加RiilRelease的权限和RiilSnapshot的权限    6.检查是否配置成功    7.创建角色,分配权限    ......
  • Maven常用插件使用说明之deploy
    Maven常用插件使用说明之deployMaven的deploy插件用于把Maven自动构建生成的版本发布到中央代理仓库如Nexus服务器上,也能把第三方依赖库(如Jar包)或一个独立的Jar包直接发布到中央代理仓库供大家共享使用。下面介绍deploy插件的具体用法。假设Nexus服务器已成功安装,Nexus控制台URL......
  • Maven project 中,运行时获取某依赖的版本号
    <dependency> <groupId>cn.xs</groupId> <artifactId>qishi-api</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency>  // D:\mvnrepository\cn\xs\qishi-api\0.0.1-SNAPSHOT\qishi-api......
  • 使用Eclipse构建Maven的SpringMVC项目
    使用Eclipse构建Maven的SpringMVC项目      首先Eclipse需要安装Maven的插件,地址:http://m2eclipse.sonatype.org/sites/m2e。     用MyEclipse安装Maven插件,建出的Maven项目有些问题。一是,发布tomcat的时候resources总是不会被发布到tomcat下;二是,把WEB-INF下的cla......
  • Maven部署构件至远程仓库
    我们知道,Maven仓库包括本地仓库和远程仓库,而远程仓库又包括中央仓库,私服,Jboss仓库和Java.net仓库等。私服,即私有的仓库服务器,它不仅可以降低中央仓库负荷,节省外网带宽,还可以加速Maven构建,自己部署构件等,从而高效地使用Maven。对于私服,我们可以使用仓库管理软件来创建自己的私有仓......
  • maven-jar-plugin 定制包含哪些内容,不包含哪些
    http://maven.apache.org/plugins/maven-jar-plugin/usage.html控制打包内容<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-pl......
  • maven-antrun-plugin
    1) 依赖 2)默认的classpath http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.htmlmaven.compile.classpathmaven.runtime.classpathmaven.test.classpathmaven.plugin.classpath3)示例<targetname="slice2java"><mk......
  • 26) minify-maven-plugin 合并压缩 js css文件
     http://samaxes.github.io/minify-maven-plugin/minify-mojo.html <build><plugins><plugin><groupId>com.samaxes.maven</groupId><artifactId>minify-maven-plugin</artifactId><version&g......
  • 27) yuicompressor-maven-plugin 合并压缩 js css文件
    http://davidb.github.io/yuicompressor-maven-plugin/compress-mojo.html<plugin><groupId>net.alchim31.maven</groupId><artifactId>yuicompressor-maven-plugin</artifactId><version>1.5.1</......