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

multi module dependency problem #431

Open
yylstudy opened this issue Sep 6, 2024 · 0 comments
Open

multi module dependency problem #431

yylstudy opened this issue Sep 6, 2024 · 0 comments

Comments

@yylstudy
Copy link

yylstudy commented Sep 6, 2024

After obfuscate of multiple modules, there appears code that is not obfuscate
image
As shown in the picture
fzhx-starter-core refers to fzhx-core, and the proguard man plugin is added to fzhx-starter-core. The complete pom is.

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>fzhx-starter</artifactId>
        <groupId>com.zyaud.fzhx</groupId>
        <version>2.0.2-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>fzhx-starter-core</artifactId>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.zyaud.fzhx</groupId>
            <artifactId>fzhx-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>com.github.wvengen</groupId>
                <artifactId>proguard-maven-plugin</artifactId>
                <version>2.6.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>proguard</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <injar>${project.build.finalName}.jar</injar>
                    <outjar>${project.build.finalName}.jar</outjar>
                    <obfuscate>true</obfuscate>
<!--                    <includeDependencyInjar>true</includeDependencyInjar>-->
                    <putLibraryJarsInTempDir>true</putLibraryJarsInTempDir>
                    <proguardInclude>${project.basedir}/proguard.cfg</proguardInclude>
                    <!-- 额外的jar包,通常是项目编译所需要的jar -->
                    <libs>
                        <lib>${java.home}/lib/rt.jar</lib>
                        <lib>${java.home}/lib/jce.jar</lib>
                        <lib>${java.home}/lib/jsse.jar</lib>
                    </libs>
                    <assembly>
                        <inclusions>
                            <inclusion>
                                <groupId>com.zyaud.fzhx</groupId>
                                <artifactId>fzhx-core</artifactId>
                            </inclusion>
                        </inclusions>
                    </assembly>
                    <outputDirectory>${project.basedir}/target</outputDirectory>
                    <options>
                    </options>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.guardsquare</groupId>
                        <artifactId>proguard-base</artifactId>
                        <version>7.1.1</version>
                        <scope>runtime</scope>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>

It can be seen that fzhx-core is configured in the assembly to package fzhx-starter-core.
In addition, I introduced fzhx-starter-core in spring-boot-test
spring-boot-test pom is
image

but found that all dependencies in spring-boot-test depend on fzhx-core, which is not confused.
image

fzhx-starter-core contains obfuscated fzhx-core code, which may cause problems. How can I solve this problem?
Thank you very much! Is my usage incorrect?

@Guardsquare Guardsquare deleted a comment from w2wewwww Sep 6, 2024
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

1 participant