精华内容
下载资源
问答
  • 前端开源库-repackage

    2019-08-30 08:21:43
    前端开源库-repackage重新打包,从其组件部分构建package.json文件。修复环境变量使用,使脚本与Windows和OSX兼容。
  • 在运行spring-boot:repackage时 ~/Desktop/MyProject/springboot$ mvn spring-boot:repackage 会出现异常: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.5.RELEASE:...

    在运行spring-boot:repackage时

    ~/Desktop/MyProject/springboot$ mvn spring-boot:repackage
    

    会出现异常:
    Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.5.RELEASE:repackage failed: Source file must be provided

    分析过程:
    spring-boot:repackage在执行过程中,首先读取已经打包的jar文件,然后进行必要的启动设置,并最终输出可执行的jar文件。出现异常应该是没能读取到mvn package打包的jar文件。

    解决方法:

    ~/Desktop/MyProject/springboot$ mvn package spring-boot:repackage
    

    重新打包成功!

    由于spring-boot:repackage是Spring Boot Maven Plugin的默认goal,所以再次尝试mvn package,发现同样输出了可执行的jar文件。
    因此,为了重新打包得到Spring Boot可执行的jar文件,要避免直接执行mvn spring-boot:repackage。执行mvn package spring-boot:repackage或者mvn package即可。

    展开全文
  • Execution default of goal org.springframework.boot:spring-boot-maven-plugin:XXXX RELEASE:repackage failed: Unable to find main class 根源为,在我的项目场景下, 只有如图的-boot子模块生产可执行JAR包...

    Spring boot 执行打包操作时候,报错如下


    Execution default of goal org.springframework.boot:spring-boot-maven-plugin:XXXX RELEASE:repackage failed: Unable to find main class

    根源为,在我的项目场景下,

    只有如图的-boot子模块生产可执行JAR包,其他几个模块是不需要可执行的,而我的根POM里,spring boot 默认帮我加入了如下build策略

    <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>


    解决方案比较简单,就是把这个spirng boot针对所有模块的build部分移除出来,放到你自己需要打包的那个子模块里,我这里是api-service-boot模块,其他模块不需要生产可执行的jar.
    ————————————————
    版权声明:本文为CSDN博主「@Within」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_41264674/article/details/106539584

    展开全文
  • repackage failed: Unable to find main class

    千次阅读 2019-11-01 10:45:39
    问题: 执行mvn clean packege时总有一个包打包不...[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage (repackage) on project loan-common: Execution...

    问题:

    执行mvn clean packege 时总有一个包打包不过去,说找不主类,错误如下:

    [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage (repackage) on project loan-common: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage failed: Unable to find main class -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage (repackage) on project my-common: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage failed: Unable to find main class
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:483)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    Caused by: org.apache.maven.plugin.PluginExecutionException: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage failed: Unable to find main class
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)

    查找原因

    最终检查所有模块配置,发现总pom.xml文件中有打包插件。

    而该插件只能在需要启动的web模块,最终启动的(jar或者war包的)pom文件中,其他模块是不需要的,总pom中也不需要。

    否则会导致打包的时候报错。

    解决方案:

    删掉除web模块下,其他所有pom文件中的打包插件,整理清楚依赖关系。

    1、只有总pom文件 打包为:<packaging>pom</packaging>

    主要配置为:

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.4.RELEASE</version>
        <relativePath/>
    </parent>
    <groupId>com.ylj.student</groupId>
    <artifactId>myproject</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>myproject</name>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>
    
    <modules>
        <module>my-web</module>
        <module>my-service</module>
        <module>my-dao</module>
        <module>my-common</module>
    </modules>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.18.8</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>2.1.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>2.1.4.RELEASE</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    2、其他子模块pom文件 打包为: <packaging>jar</packaging>

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.ylj.student</groupId>
        <artifactId>myproject</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    
    <artifactId>my-common</artifactId>
    <packaging>jar</packaging>
    <name>my-common</name>
    
    <dependencies>
        <dependency>
            <groupId>com.ylj.student</groupId>
            <artifactId>my-dao</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
    
    </dependencies>

    3、web模块pom文件 打包为: <packaging>jar</packaging>,同时添加maven 插件。

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>om.ylj.student</groupId>
        <artifactId>myproject</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <artifactId>my-web</artifactId>
    <name>my-web</name>
    <packaging>jar</packaging>
    
    <dependencies>
        <dependency>
            <groupId>com.ylj.student</groupId>
            <artifactId>my-common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>om.ylj.student</groupId>
            <artifactId>my-service</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

     

     



     

     

    展开全文
  • Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:repackage (repackage) on project core: Execution repackage of goal org.springframework.boot:spring-boot-maven-...

    今天在用maven对项目进行install时,提示报错:

    Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:repackage (repackage) on project core: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:repackage failed: Unable to find main class

    错误的意思,大概就是在core模块打包时,找不到主类,就是maven打包插件有问题,查看项目依赖发现:

    父模块,子模块Core模块、Web模块都添加了maven打包插件:

    在网上看了一些方法后,解决方法

    就是去掉父模块其他子模块的这个插件 ,只在web工程中加入这个打包插件!

    然后重新install,不再报错

    展开全文
  • 本人准备通过使用spring-boot-maven-plugin插件中的repackage进行打包 ![](https://img2020.cnblogs.com/blog/1758148/202011/1758148-20201103150935343-562719938.png) 但是运行成功之后找不到jar包 ![]...
  • [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.0.RELEASE:repackage (repackage) on project mmd-service: Execution repackage of goal org.springframework.boot:spring...
  • https://www.cnblogs.com/zhouqinxiong/p/repackage.html 简介  Spring Boot Maven Plugin插件提供spring boot在maven中的支持。允许你打包可运行的jar包或war包。...spring-boot:repackage 请阅读...
  • 简介  Spring Boot Maven Plugin插件提供spring boot在maven中的支持。允许你打包可运行的jar包或war包。...spring-boot:repackage 请阅读:Spring cloud的Maven插件(一):repackage目标 spring-boot:run ...
  • maven 打包问题(repackage failed: Unable to find main class) 问题背景:今天用spring boot做了一个公共模块,需要打成jar包,让其他项目引用,但打包的时却提示缺少主类,但是我这一个公共模块,本来就没写主类...
  • 在Spring Boot应用构建完成后,修改了中间生成的代码,希望能够更新最终的jar包。...Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.4.RELEASE:repackage (default-cli) on pr
  • SpringBoot项目用maven插件...[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repackage (repackage) on project facesf: Execution repackage of goal org.spri
  • Spring Boot Maven Plugin -- repackage目标

    千次阅读 2017-09-14 10:38:08
    简介  Spring Boot Maven Plugin插件提供spring boot在maven中的支持。允许你打包可运行的jar包或war包。...spring-boot:repackage spring-boot:run spring-boot:start and spring-boot:stop s
  • [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.0.RELEASE:repackage (repackage) on project mb-bg-fw-web: Execution repackage of goal org.springframework.boot:...
  • 今天遇到一个着实让人蛋疼的问题,repackage failed: Unable to find main class 我是一个多模块依赖的项目,通用工具类打包的时候上面的错误,耽误了我十几分钟,后来忽然想到,工具包打包的时候不应该有maven的...
  • 关闭rpmbuild 对jar包的repackage 操作

    千次阅读 2014-11-19 22:12:22
    关闭rpmbuild 对jar包的repackage 操作 jiej
  • Execution default of goal org.springframework.boot:spring-boot-maven-plugin:XXXX RELEASE:repackage failed: Unable to find main class 根源为,在我的项目场景下, 只有如图的-boot子模块生产可执行JAR包...
  • 一、Maven打包Spring Boot项目报错(repackage failed: Unable to find main class),排除寻找Main方法,一般用于被依赖的公用常量模块,解决方法如下: <build> <plugins> <plugin> <...
  • Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage (repackage) on project spider-data: Execution repackage of goal org.springframework.boot:spring-boot-...
  • install时出现[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.3....repackage (default) on project sunM-soa-domain: Execution default of goal org.springframework...
  • Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:repackage (repackage) on project CSDN: Execution repackage of goal org.springframework.boot:spring-boot-maven-...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 7,534
精华内容 3,013
关键字:

repackage