• maven工具引入lib下的jar文件


                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <executable>true</executable><!-- 直接运行,注册服务 -->
                        <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
                        <includeSystemScope>true</includeSystemScope>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

    1、配置includeSystemScope

    2、添加依赖:

    <dependency>
    			<groupId>jave</groupId>
    			<artifactId>jave</artifactId>
    			<version>1.0.2</version>
    			<scope>system</scope>
    			<systemPath>${project.basedir}/lib/jave-1.0.2.jar</systemPath>
    		</dependency> 
    

    3、bulid添加配置:

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <compilerArguments>
                            <!-- 打包本地jar包 -->
                            <extdirs>${project.basedir}/lib</extdirs>
                        </compilerArguments>
                    </configuration>
                </plugin>
            </plugins>
        </build>

    4、打包即可;

    --------------------------

    使用jave.jar读取视频时长:

    	public static String readVideoTime(File source) {
    		Encoder encoder = new Encoder();
    		String length = "";
    		try {
    			System.out.println("开始解析视频时长:"+source.getAbsolutePath());
    			MultimediaInfo m = encoder.getInfo(source);
    			long ls = m.getDuration() / 1000;
    			int hour = (int) (ls / 3600);
    			int minute = (int) (ls % 3600) / 60;
    			int second = (int) (ls - hour * 3600 - minute * 60);
    			length = (hour<10?"0":"") + hour + ":" + (minute<10?"0":"") + minute + ":" + (second < 10?"0":"") + second + "";
    			System.out.println("解析视频时长结束:"+length);
    		} catch (Exception e) {
    			length = "-";
    			System.err.println(e.getMessage());
    		}
    		return length;
    	}
    

      

  • 相关阅读:
    JZOJ1495 宝石
    JZOJ1496 页
    jzoj1497. 景点中心
    2019.8.2总结
    学习进度报告2021/3/19
    学习进度报告2021/3/18
    《学会提问》读书笔记2
    学习进度报告2021/3/17
    学习进度报告2021/3/16
    学习进度报告2021/3/15
  • 原文地址:https://www.cnblogs.com/liangblog/p/11928681.html
Copyright © 2020-2023  润新知