Skip to content

spring-boot plugin + obfuscation doesn't work in Maven multi-module project #3444

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

Closed
oleghailenko opened this issue Jul 8, 2015 · 5 comments
Assignees
Milestone

Comments

@oleghailenko
Copy link

I have a multi-module Maven project. One of the modules is a web application. When I build Web project, all jar files are copied to target directory and then obfuscation runs over them.
But I discovered that after this spring-boot plugin uses original jars of the other modules while packaging of war (but not from target directory of that web project).
As a result war-archive contains obfuscated web module , but the not obfuscated other modules.

I also discovered that there is no such problem with 1.2.1.RELEASE.

@philwebb philwebb added this to the 1.2.6 milestone Jul 8, 2015
@philwebb
Copy link
Member

philwebb commented Jul 8, 2015

What product are you using to perform obfuscation? Can you share a sample project that reproduces the issue?

@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Jul 8, 2015
@oleghailenko
Copy link
Author

For obfuscation I am using proguard. Here repo with simple project: https://github.com/oleghailenko/spring-boot-obj

@wilkinsona wilkinsona self-assigned this Jul 9, 2015
@wilkinsona wilkinsona removed the status: waiting-for-feedback We need additional information before we can continue label Jul 9, 2015
@wilkinsona
Copy link
Member

You need to tell Boot's repackaging to ignore the obfuscated modules as you've already pulled them into the war file as web resources. You can do that by adding an exclude to your configuration of Boot's plugin:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <mainClass>org.test.WebModule.Application</mainClass>
        <excludeGroupIds>org.example</excludeGroupIds>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
</plugin>

@wilkinsona
Copy link
Member

And I just noticed that you think this worked without the exclude in 1.2.1.RELEASE so the exclude-based approach I described above shouldn't be necessary

@wilkinsona
Copy link
Member

The change in behaviour was introduced in f761916

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

3 participants