Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no main manifest attribute #164

Open
ThanhDat2804 opened this issue Oct 28, 2024 · 1 comment
Open

no main manifest attribute #164

ThanhDat2804 opened this issue Oct 28, 2024 · 1 comment

Comments

@ThanhDat2804
Copy link

ThanhDat2804 commented Oct 28, 2024

when i run my obfuscated.jar it show error no main manifest attribute, in target\crud-spring-boot-thymeleaf-0.0.1-SNAPSHOT-obfuscated.jar here is my build

                    <configuration>
                        <target>
                            <taskdef name="yguard"
                                     classname="com.yworks.yguard.YGuardTask"
                                     classpathref="maven.plugin.classpath"/>

                            <yguard>
                                <inoutpair in="${project.build.directory}/${project.build.finalName}.jar"
                                           out="${project.build.directory}/${project.build.finalName}-obfuscated.jar"/>

                                <rename mainclass="com.crudapp.SpringBootCrudApplication"
                                        logfile="${project.build.directory}/renaming-log.xml">
                                    <keep>
                                        <!-- Main Spring Boot Application -->
                                        <class name="com.crudapp.SpringBootCrudApplication"/>

                                        <!-- Spring components and configurations -->
                                        <class name="com.crudapp.entity.*"/>
                                        <class name="com.crudapp.repository.*"/>
                                        <class name="com.crudapp.service.*"/>
                                        <class name="com.crudapp.service.impl.*"/>

                                        <!-- Keep Spring annotations -->
                                        <class name="org.springframework.**"/>
                                        <class name="jakarta.persistence.**"/>

                                        <!-- Optionally keep all classes in your package -->
                                        <class name="com.crudapp.**"/>
                                    </keep>
                                </rename>
                            </yguard>
                        </target>
                    </configuration>
@thomasbehr
Copy link
Member

This is from your Maven POM, right? In this case, please see the processing example POM. All the steps in the example's antrun configuration are necessary to successfully obfuscate a Spring Boot application (see the inline comment right before the antrun configuration). You probably need to adjust your configuration accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants