关于在windows中将rocketMQ控制台打包

mvn clean package -Dmaven.test.skip=true

如果提示

'mvn' 不是内部或外部命令,也不是可运行的程序或批处理文件。

需要去安装maven并配置环境变量,这个网上已经有很多教程了

言归正传,在执行时遇到了三个问题

1.首先是

[INFO] Installing node version v16.2.0
[INFO] Downloading https://nodejs.org/dist/v16.2.0/win-x64/node.exe to D:\ProgramData\repo\com\github\eirslett\node\16.2.0\node-16.2.0-win-x64.exe
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly

它会卡在这,原因是代理服务器没有资源,这时候可以等一会,它会自动转为直接下载。或者选择自己手动下载,参考Downloading里面的下载地址,下载的文件放到to后面的文件目录中去,重新执行

2.然后又遇到了依赖项无资源可下载的问题

[ERROR] Failed to execute goal on project rocketmq-dashboard: Could not resolve dependencies for project org.apache.rocketmq:rocketmq-dashboard:jar:1.0.1-SNAPSHOT: Could not find artifact com.sun.xml.bind:jaxb-core:jar:2.3.1 in aliyunMavenRepositoryPublic (https://maven.aliyun.com/repository/public) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

这时候需要更改pom.xml文件里报错的依赖的version,我这里是直接将

<jaxb-api.version>2.3.1</jaxb-api.version>

修改为

<jaxb-api.version>2.3.0</jaxb-api.version>

并且添加了jaxb-api以外的别的依赖,具体如下

<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>${jaxb-api.version}</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-core</artifactId>
    <version>${jaxb-api.version}</version>
</dependency>
<dependency>
    <groupId>javax.activation</groupId>
    <artifactId>activation</artifactId>
    <version>1.1.1</version>
</dependency>

3.最后遇到

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.3:yarn (yarn install) on project rocketmq-dashboard: Failed to run task: 'yarn install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

最后是将pom.xml中的frontend-maven-plugin和maven-antrun-plugin插件注释掉就能打包成功了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值