Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

打包时报错,请教大神解决办法 #2

Open
yhyzgn opened this issue Feb 15, 2019 · 25 comments
Open

打包时报错,请教大神解决办法 #2

yhyzgn opened this issue Feb 15, 2019 · 25 comments

Comments

@yhyzgn
Copy link

yhyzgn commented Feb 15, 2019

运行mvn package时报错:org.apache.maven.plugin.InvalidPluginDescriptorException: Invalid plugin descriptor for com.github.core-lib:xjar-maven-plugin:1.0.8,插件配置如下:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
    <groupId>com.github.core-lib</groupId>
    <artifactId>xjar-maven-plugin</artifactId>
    <version>1.0.8</version>
    <executions>
        <execution>
            <goals>
                <goal>build</goal>
            </goals>
            <phase>package</phase>
            <configuration>
                <password>io.xjar</password>
            </configuration>
        </execution>
    </executions>
</plugin>
@core-lib
Copy link
Owner

加了 repository吗

@core-lib
Copy link
Owner

<pluginRepositories>
    <pluginRepository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </pluginRepository>
</pluginRepositories>
<!-- 添加 XJar Maven 插件 -->

@yhyzgn
Copy link
Author

yhyzgn commented Feb 15, 2019

加了

<!-- 设置 jitpack.io 仓库 -->
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://www.jitpack.io</url>
    </repository>
</repositories>
<!-- 设置 jitpack.io 插件仓库 -->
<pluginRepositories>
    <pluginRepository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </pluginRepository>
</pluginRepositories>

@core-lib
Copy link
Owner

哦哦 版本写错 是 v1.0.8

@yhyzgn
Copy link
Author

yhyzgn commented Feb 15, 2019

好的,可以了,谢谢

@core-lib
Copy link
Owner

OK

@icielo
Copy link

icielo commented Apr 1, 2019

请问怎么运行? 运行 xjar? java -jar ??

@core-lib
Copy link
Owner

core-lib commented Apr 1, 2019

java -jar /path/to/your/xjar

@icielo
Copy link

icielo commented Apr 10, 2019

image
image
image
image

你好,我运行时报找不到启动类“错误: 找不到或无法加载主类 io.xjar.boot.XBootLauncher”

@core-lib
Copy link
Owner

你的类是不是没有包名

@icielo
Copy link

icielo commented Apr 10, 2019

是没有包名。我就简单先弄了个工程看看能不能跑

@icielo
Copy link

icielo commented Apr 10, 2019

image
但是我加上包名也是一样的错误

@icielo
Copy link

icielo commented Apr 10, 2019

可以帮忙弄个简单demo吗?或者 clone下 https://github.com/icielo/jitpack 看看

@core-lib
Copy link
Owner

我先看下

@core-lib
Copy link
Owner

core-lib commented Apr 10, 2019

我看了你的 demo 有两个问题

  1. 仓库地址写错了 是 https://jitpack.io 不是 https://www.jitpack.io
  2. spring-boot-maven-plugin 版本要用2.0.0.RELEASE 以上的

你改了这两个问题就可以了

@icielo
Copy link

icielo commented Apr 10, 2019

可以了。非常感谢大神。

@core-lib
Copy link
Owner

OK

@thinkingfioa
Copy link

非spring-boot项目。通过在pom.xml文件中添加xjar-maven-plugin插件,抛出异常: java.lang.ClassNotFoundException: org.apache.commons.compress.archivers.jar.JarArchiveInputStream。
maven的本地仓库明明有org.apache.commons/commons-compress 1.18版本的jar

@core-lib
Copy link
Owner

把本地这个文件夹删掉再build一次

@thinkingfioa
Copy link

文件夹删除后,不会自动下载。我是私服。如果通过在pom.xml配置中添加标签可以自动下载

@core-lib
Copy link
Owner

你用版本多少

@thinkingfioa
Copy link

v2.0.6

@core-lib
Copy link
Owner

image
你参考下这个

@thinkingfioa
Copy link

thinkingfioa commented Jul 23, 2019

不行,我先在外网写一个Demo试试。谢谢你

@core-lib
Copy link
Owner

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants