当前位置:   article > 正文

java如何打jar包_不使用pom.xml文件导入jar

不使用pom.xml文件导入jar

1)创建maven工程

2)pom.xml引入依赖

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.apache.maven.plugins</groupId>
  5. <artifactId>maven-assembly-plugin</artifactId>
  6. <version>2.5.5</version>
  7. <configuration>
  8. <archive>
  9. <manifest>
  10. <mainClass>com.gd.net.NetMain</mainClass>
  11. </manifest>
  12. </archive>
  13. <descriptorRefs>
  14. <descriptorRef>jar-with-dependencies</descriptorRef>
  15. </descriptorRefs>
  16. </configuration>
  17. <!--下面是为了使用 mvn package命令,如果不加则使用mvn assembly-->
  18. <executions>
  19. <execution>
  20. <id>make-assemble</id>
  21. <phase>package</phase>
  22. <goals>
  23. <goal>single</goal>
  24. </goals>
  25. </execution>
  26. </executions>
  27. </plugin>
  28. </plugins>
  29. </build>
  30. <dependencies>
  31. <dependency>
  32. <groupId>org.bouncycastle</groupId>
  33. <artifactId>bcprov-jdk15on</artifactId>
  34. <version>1.56</version>
  35. </dependency>
  36. </dependencies>

3)clean-install

 

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

闽ICP备14008679号