Giovanni-Mattia-Codemo / ingsw2022-AM12

1 stars 0 forks source link

cannot build a real runnable JAR #12

Closed ingconti closed 2 years ago

ingconti commented 2 years ago

maybe shade can help.

below a piece of my POM

        <!-- added SHADE plug in -->

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.2.0</version>

            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <shadedArtifactAttached>true</shadedArtifactAttached>
                        <shadedClassifierName>project-classifier</shadedClassifierName>
                        <outputFile>shade\${project.artifactId}.jar</outputFile>
                        <transformers>
                            <transformer implementation=
                                                 "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>com.ingconti.Launcher</mainClass>
                            </transformer>
                        </transformers>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <!-- end of added -->
ValerioCapo commented 2 years ago

i tweaked the pom as instructed, plus a couple more changes but i wanted to ask if i should ignore a warning that came up because of the added shade: [WARNING] Discovered module-info.class. Shading will break its strong encapsulation.

as of now module-info.class simply stores some code for the javafx example executable to find its needed .fxml resources.

ingconti commented 2 years ago

YES is nt your fault.. (even serious cod has flaws... :)