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

Specifying ignoredEntries for quarkus-maven-plugin has no effect #10406

Closed
sebthom opened this issue Jul 1, 2020 · 8 comments · Fixed by #10415
Closed

Specifying ignoredEntries for quarkus-maven-plugin has no effect #10406

sebthom opened this issue Jul 1, 2020 · 8 comments · Fixed by #10415
Assignees
Labels
area/maven kind/bug Something isn't working
Milestone

Comments

@sebthom
Copy link
Contributor

sebthom commented Jul 1, 2020

Describe the bug
Specifying <ignoredEntries><ignoredEntry> settings in quarkus-maven-plugin maven configuration has no effect.
The resulting uberJar still contains all files that are marked for exclusion.

Expected behavior
Specified exclusions are processed and the listed files are excluded from the uberJar.

Actual behavior
Files matching specified exclusions are excluded from resulting jar.

To Reproduce
Steps to reproduce the behavior:

  1. mvn clean package

Configuration
Plugin configuration in the pom.xml:

         <plugin>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-maven-plugin</artifactId>
            <version>${quarkus.version}</version>
            <executions>
               <execution>
                  <goals>
                     <goal>build</goal>
                  </goals>
                  <configuration>
                     <uberJar>true</uberJar>
                     <ignoredEntries>
                        <ignoredEntry>META-INF/swagger-ui-files/swagger-ui-bundle.js.map</ignoredEntry>
                        <ignoredEntry>META-INF/swagger-ui-files/swagger-ui-standalone-preset.js.map</ignoredEntry>
                     </ignoredEntries>
                  </configuration>
               </execution>
            </executions>
         </plugin>

Environment (please complete the following information):

  • Output of uname -a or ver: Windows 10x64
  • Output of java -version:
    openjdk version "11.0.7" 2020-04-14
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
    
  • GraalVM version (if different from Java): n/a
  • Quarkus version or git rev: 1.5.2.Final and 1.6.0.CR1
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3

Additional information:
Looking at the source code of the Quarkus Maven Build Goal, it seems like someone forgot to actually implement processing of ignoredEntries: https://github.com/quarkusio/quarkus/blob/1.6.0.CR1/devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java#L126
A private field ignoredEntries is defined but it is not used in the code.

@sebthom sebthom added the kind/bug Something isn't working label Jul 1, 2020
@quarkusbot
Copy link

/cc @quarkusio/devtools

@gastaldi gastaldi self-assigned this Jul 1, 2020
@aloubyansky
Copy link
Member

Here is a consequence of adding a feature w/o any test. bf26eb8#diff-fc5bfcac2e033b00de4f2bfe6b02a1ac

@sebthom
Copy link
Contributor Author

sebthom commented Jul 1, 2020

This looks like the commit that broke the feature: 0d3335d#diff-fc5bfcac2e033b00de4f2bfe6b02a1ac

@gastaldi
Copy link
Contributor

gastaldi commented Jul 1, 2020

Apparently they are no longer specified in the plugin, but in the application.properties:

/**
* Files that should not be copied to the output artifact
*/
@ConfigItem
public Optional<List<String>> userConfiguredIgnoredEntries;

I tried adding these to the application.properties but it still didn't work:

quarkus.package.user-configured-ignored-entries=META-INF/swagger-ui-files/swagger-ui-bundle.js.map,META-INF/swagger-ui-files/swagger-ui-standalone-preset.js.map

I'm investigating it

@sebthom
Copy link
Contributor Author

sebthom commented Jul 1, 2020

Probably quarkus.package.user-configured-ignored-entries is processed before the uberJar is created. I am looking for a way to get rid of unnecessary files from the uberJar that come from maven dependencies.

@gastaldi
Copy link
Contributor

gastaldi commented Jul 1, 2020

@sebthom I might have fixed this in: #10415

Can you give it a try?

@sebthom
Copy link
Contributor Author

sebthom commented Jul 2, 2020

@gastaldi I just tried it. It seems to work now. Thanks for the quick fix! Unfortunately it does not work with wildcards, e.g. META-INF/swagger-ui-files/*.js.map or even better META-INF/**/*.js.map, but I guess that is a different story.

@gastaldi
Copy link
Contributor

gastaldi commented Jul 2, 2020

Thanks @sebthom. I created #10441 requesting wildcard support.

@gsmet gsmet added this to the 1.7.0 - master milestone Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/maven kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants