简体   繁体   English

Maven全新安装intelij,但不在终端中

[英]Maven clean install work in intelij but not in terminal

I build library which use spring-boot-autoconfigure to configure spring context. 我建立使用spring-boot-autoconfigure来配置spring上下文的库。 I build project by maven config in Intelij and it work perfect, but when i run mvn clean install in terminal maven throw errors that it is impossible to find any method, classes etc. Project is library so build configuration cannot include any main path. 我在Intelij中通过maven config构建项目,它可以完美运行,但是当我在终端maven中运行mvn clean install ,抛出错误,无法找到任何方法,类等。项目是库,因此构建配置不能包含任何主路径。

This is my maven config 这是我的Maven配置

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

The command which intellij execute in maven clean install config look like this intellij在maven clean install config中执行的命令如下所示

<java-path> -Dmaven.multiModuleProjectDirectory=<project-root-dir-path> -Dmaven.home=<intellij-maven-path> -Dclassworlds.conf=/.../JetBrains/Toolbox/apps/IDEA-U/ch-0/183.5429.30/plugins/maven/lib/maven3/bin/m2.conf -javaagent:/.../JetBrains/Toolbox/apps/IDEA-U/ch-0/183.5429.30/lib/idea_rt.jar=37847:/.../JetBrains/Toolbox/apps/IDEA-U/ch-0/183.5429.30/bin -Dfile.encoding=UTF-8 -classpath /.../JetBrains/Toolbox/apps/IDEA-U/ch-0/183.5429.30/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2018.3.4 clean install

The dots in paths are my system path to JetBrains directory. 路径中的点是我到JetBrains目录的系统路径。

Can anyone give me tip to configure this maven project to build jar by clean install . 谁能给我提示以配置该Maven项目以通过clean install来构建jar。 Remember that there is no main method because it is only library project. 请记住,没有主要方法,因为它只是库项目。

Thanks to Ajay Kumar adding this dependencies repair the problem 感谢Ajay Kumar添加此依赖项来修复问题

<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-controls</artifactId>
    <version>13-ea+11</version>
</dependency>
<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-fxml</artifactId>
    <version>13-ea+11</version>
</dependency>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM