1

I build library which use spring-boot-autoconfigure to configure spring context. 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.

This is my maven config

<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

<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.

Can anyone give me tip to configure this maven project to build jar by clean install. Remember that there is no main method because it is only library project.

Sebastian
  • 92
  • 2
  • 14
  • why worried about main? From your terminal change directory to the directory where your pom file is. And if you have maven path etc configured properly in your machine, mvn clean install should run without any issues as long as you have a valid internet connection. Did I miss anything here? Hope it helps if I understood correctly. – Ajay Kumar Jul 30 '19 at 19:30
  • I have already tried it but it fails with errors `java:[91,9] cannot find symbol`. I am sure that i have configure maven and java correctly because other projects are build without any problems. So maybe simple `mvn clean install` is not enough, maybe i should configure build plugin more specific for the case of project without main method ? – Sebastian Jul 30 '19 at 19:35
  • share full trace of the output. "cannot find symbol" means some compilation issues in your code. SHow us what this "java:[91,9]" has? – Ajay Kumar Jul 30 '19 at 19:37
  • this error is throw for every class, method and package see it here : https://pastebin.com/BAvZGwhh – Sebastian Jul 30 '19 at 19:41
  • Wild guess.. are you using open java (jdk/jre) ? if yes, try this - https://stackoverflow.com/questions/27178895/cannot-resolve-symbol-javafx-application-in-intellij-idea-ide. Dude, you need to fix your compilation issues first. I don't think you don't have maven configured properly. Because if maven is not configured properly, you will get an error immediately - mvn command not found (similar). Do some digging. Get some caffeine and sit with a fresh mind. – Ajay Kumar Jul 30 '19 at 19:49
  • I dont have openJDK because when i build this project by intelij everythink work perfectly fine. I also use this jar in another project and it also import all javaFX libraries etc. I am searching this issue for 3 days and i dont know what can i fix. – Sebastian Jul 30 '19 at 19:53
  • 1
    Here you go - https://coderanch.com/t/692049/intellij-idea/ide/javafx-working-Java – Ajay Kumar Jul 30 '19 at 19:54
  • OMG, thanks mate. I dont even though about adding javaFX because that project build and work as library in my jdk perfect. Sorry for that stupid problem and thanks for time. I should try this solution in first step. Anyway thanks again. – Sebastian Jul 30 '19 at 20:04
  • Good luck buddy.! – Ajay Kumar Jul 30 '19 at 20:08

1 Answers1

0

Thanks to Ajay Kumar adding this dependencies repair the problem

<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>
Sebastian
  • 92
  • 2
  • 14