当前位置:   article > 正文

maven工具引入lib下的jar文件_maven-dependency-plugin includesystemscope

maven-dependency-plugin includesystemscope

1、添加 pom.xml 文件配置includeSystemScope

  1. <plugin>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-maven-plugin</artifactId>
  4. <configuration>
  5. <executable>true</executable><!-- 直接运行,注册服务 -->
  6. <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
  7. <includeSystemScope>true</includeSystemScope> <!-- 主要的 -->
  8. </configuration>
  9. <executions>
  10. <execution>
  11. <goals>
  12. <goal>repackage</goal>
  13. </goals>
  14. </execution>
  15. </executions>
  16. </plugin>

2、添加依赖:

  1. <!-- 主要的 -->
  2. <dependency>
  3. <groupId>cn.com.westone</groupId>
  4. <artifactId>wcspsdk</artifactId>
  5. <version>1.0</version>
  6. <scope>system</scope>
  7. <systemPath>${project.basedir}/libs/wcspsdk.jar</systemPath>
  8. </dependency>

3、bulid添加配置:

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.apache.maven.plugins</groupId>
  5. <artifactId>maven-compiler-plugin</artifactId>
  6. <configuration>
  7. <source>${java.version}</source>
  8. <target>${java.version}</target>
  9. <encoding>${project.build.sourceEncoding}</encoding>
  10. <compilerArguments>
  11. <!-- 打包本地jar包 -->
  12. <extdirs>${project.basedir}/lib</extdirs>
  13. </compilerArguments>
  14. </configuration>
  15. </plugin>
  16. </plugins>
  17. </build>

4、打包即可。

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

  1. public static String readVideoTime(File source) {
  2. Encoder encoder = new Encoder();
  3. String length = "";
  4. try {
  5. System.out.println("开始解析视频时长:"+source.getAbsolutePath());
  6. MultimediaInfo m = encoder.getInfo(source);
  7. long ls = m.getDuration() / 1000;
  8. int hour = (int) (ls / 3600);
  9. int minute = (int) (ls % 3600) / 60;
  10. int second = (int) (ls - hour * 3600 - minute * 60);
  11. length = (hour<10?"0":"") + hour + ":" + (minute<10?"0":"") + minute + ":" + (second < 10?"0":"") + second + "";
  12. System.out.println("解析视频时长结束:"+length);
  13. } catch (Exception e) {
  14. length = "-";
  15. System.err.println(e.getMessage());
  16. }
  17. return length;
  18. }

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/308086
推荐阅读
相关标签
  

闽ICP备14008679号