java.lang.NoClassDefFoundError:运行bash文件构建项目时org/codehaus/plexus/classworlds/launcher/Launcher [英] java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher when running bash file to build the project
问题描述
伙计们 我已经安装了maven 2,当我在应用程序根目录中使用mvn clean或mvn install时,它可以正常工作 但是当尝试在bash脚本中使用maven安装时,出现了以上异常:
hi guys i have maven 2 installed, when i use mvn clean or mvn install in the app root it works fine but when trying to use maven install inside a bash script i got the above exception:
这是我的脚本:
#!/bin/sh
#dirname='/home/myuser/workspace/myapp'
DIRECTORY=$(cd `dirname $0` && pwd)
cd $DIRECTORY
mvn install -s resources/settings.xml $1
它在Maven 3上运行正常,但是在我安装了Maven 2并对其进行配置后,它停止工作并给了我上述异常,我不知道出了什么问题,因为常规的生成,mvn安装有效,但是从脚本进行构建不起作用,有什么主意吗?
it was working fine with maven 3, but after i installed maven 2 and configured it, it stopped working and gave me above exception, i don't know what is the problem, since the regular build, mvn install works, but building from the script doesn't work, any ideas ?
推荐答案
可能性的组合...
- One, as posted here, you have both M2_REPO and M3_REPO variables defined.
- Or you are facing this issue related to maven3 and M2_HOME
- The other is that somehow the JRE is getting used instead of JDK when run from the batch file!
这篇关于java.lang.NoClassDefFoundError:运行bash文件构建项目时org/codehaus/plexus/classworlds/launcher/Launcher的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!