fvarrui / JavaPackager

:package: Gradle/Maven plugin to package Java applications as native Windows, MacOS, or Linux executables and create installers for them.
GNU General Public License v3.0
1.07k stars 133 forks source link

The parameters 'mainClass' for goal io.github.fvarrui:javapackager:1.7.5:package are missing or invalid #385

Closed ryl0125 closed 9 months ago

ryl0125 commented 11 months ago
 <plugin>
            <groupId>io.github.fvarrui</groupId>
            <artifactId>javapackager</artifactId>
            <version>1.7.5</version>

            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>package</goal>
                    </goals>
                    <configuration>
                        <mainClass>com.example.demo.MainApp</mainClass>
                        <!-- optional -->
                        <bundleJre>true</bundleJre>
                        <platform>mac</platform>

                    </configuration>
                </execution>
            </executions>
        </plugin>
fvarrui commented 11 months ago

Hi @ryl0125! I'm not being able to reproduce your issue. I've just build a personal project using JP 1.7.5 without problems. Are you sure com.example.demo.MainApp exists? Maybe are you trying to build your project directly from IntellJ?

fvarrui commented 9 months ago

Issue closed due to lack of activity. If this issue persists, open it again, please.

sproket commented 7 months ago

I see this issue in 1.7.5 with this config:

I'm running with Java 21 with preview features. The app is JavaFX


<plugin>
                <groupId>io.github.fvarrui</groupId>
                <artifactId>javapackager</artifactId>
                <version>1.7.5</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>package</goal>
                        </goals>
                        <configuration>
                            <mainClass>game.ui.Launcher</mainClass>
                            <bundleJre>true</bundleJre>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
sproket commented 7 months ago

I think the issue is running it from the maven menu in intellij. I think it uses "mvn javapackager:package" instead of "mvn package". The latter works for this now.

fvarrui commented 7 months ago

I think the issue is running it from the maven menu in intellij. I think it uses "mvn javapackager:package" instead of "mvn package". The latter works for this now.

Thanks for the info!