eclipse - 如何寻找一个java文件的所有import的java,把这些所有java都打到一个jar包,自动化?
PHP中文网
PHP中文网 2017-04-17 16:46:11
[Java讨论组]
PHP中文网
PHP中文网

认证0级讲师

全部回复(8)
大家讲道理

最终是自己写了个小程序搞定的

ringa_lee

你都把maven当做标签了 为啥不用maven呢?

黄舟

可以使用Maven的maven-assembly-plugin插件或maven-shade-plugin插件,打成的jar包会带有所有依赖。可以参考我的一篇博客:http://xxgblog.com/2015/08/07/maven-create-executable-jar/

巴扎黑

使用ant构建工具,可以配置自动化编译的。

天蓬老师

可以直接使用maven 我之前些工具包就是用的maven

天蓬老师

给你一个参考

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <build>
        <finalName>greys-core</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <encoding>UTF-8</encoding>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                            <archive>
                                <manifest>
                                    <mainClass>com.github.ompc.greys.core.GreysLauncher</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>


</project>         
高洛峰

maven挺好用的啊

PHPz

发现个博文不错,分享下:https://segmentfault.com/a/1190000005155826

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号