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

Relocate XSD in XML #6

Closed
melloware opened this issue Mar 21, 2021 · 28 comments
Closed

Relocate XSD in XML #6

melloware opened this issue Mar 21, 2021 · 28 comments

Comments

@melloware
Copy link
Contributor

melloware commented Mar 21, 2021

We currently use this plugin to shade PrimeFaces for a Jakarta EE version to convert javax to jakarta files.

But we have this open ticket it would be great to be able to replace XSD definitions inside XML files.

See: primefaces/primefaces#7087

@rmannibucau
Copy link
Contributor

@melloware makes sense for me (even if it should be useless for javax -> jakarta since EE servers must support both). Do you want to do a PR of a new transformer? Can probably start with a plain string replacer impl.

@melloware
Copy link
Contributor Author

Yep let me see what I can come up with.

@rmannibucau
Copy link
Contributor

@melloware any news on that? @Vlatombe just did a PR in 0.0.2 version which eases xml replacements using string replacements so guess it can be "solved"?

@melloware
Copy link
Contributor Author

Oh awesome!!! Yes this can be solved . I totally forgot about this ticket :)

@melloware
Copy link
Contributor Author

@rmannibucau When I try and replace

<relocation>
         <pattern>http://java.sun.com/xml/ns/javaee</pattern>
         <shadedPattern>https://jakarta.ee/xml/ns/jakartaee</shadedPattern>
</relocation>

It comes out incorrectly like this...

<faces-config xmlns="https:..jakarta.ee.xml.ns.jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="https:..jakarta.ee.xml.ns.jakartaee https:..jakarta.ee.xml.ns.jakartaee/web-facesconfig_2_0.xsd">

it looks like the slashes are turned to "." is there some escaping I am missing?

@melloware melloware reopened this Mar 15, 2022
@melloware melloware reopened this Mar 15, 2022
@rmannibucau
Copy link
Contributor

@melloware did you use RelocationTransformer or SourceRelocationTransformer? Also wonder if you tried escaping the slack in pattern?

@melloware
Copy link
Contributor Author

Let me try the SourceRelocationTransformer and I did try escaping but didn't look at the code throughly that something is converting all / to .

@melloware
Copy link
Contributor Author

SourceRelocationTransformer had same outcome.

1 similar comment
@melloware
Copy link
Contributor Author

SourceRelocationTransformer had same outcome.

@rmannibucau
Copy link
Contributor

@melloware path transformer should enable you to reach what you want, can even use rawString option of the relocator configuration.

@melloware
Copy link
Contributor Author

Nice i will give it a shot when you publish 0.3!

@rmannibucau
Copy link
Contributor

rmannibucau commented Mar 15, 2022

done, should sync on central soon

@melloware
Copy link
Contributor Author

@rmannibucau sorry but I can't get this to work at all.

 <transformer implementation="io.yupiik.maven.shade.transformer.PathRelocationTransformer">
      <delegates>
             <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                   <resource>META-INF/faces-config.xml</resource>
            </transformer>
     </delegates>
</transformer>
...
<relocations>
            <relocation>
                   <pattern>http://java.sun.com/xml/ns/javaee</pattern>
                   <shadedPattern>https://jakarta.ee/xml/ns/jakartaee</shadedPattern>
            </relocation>
</relocations>

Is not transforming anything now. Its like its not picking up the relocations values at all now?

@rmannibucau
Copy link
Contributor

@melloware idea is

so you should add <rawString>true</> in relocation

@melloware
Copy link
Contributor Author

OK I added

                         <relocation>
                                    <pattern>http://java.sun.com/xml/ns/javaee</pattern>
                                    <shadedPattern>https://jakarta.ee/xml/ns/jakartaee</shadedPattern>
                                    <rawString>true</rawString>
                                </relocation>

But now it errors with "[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (jakarta) on project primefaces: Error creating shaded jar: Problem shading JAR C:\dev\primefaces\primefaces-melloware\primefaces\target\primefaces-12.0.0-SNAPSHOT.jar entry META-INF/MANIFEST.MF: java.lang.NullPointerException"

IF I remove RawString it works but then doesn't relocate.

here is my full config of what we are trying to accomplish...

                <executions>
                    <execution>
                        <id>shade-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jakarta</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>jakarta</shadedClassifierName>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                <transformer implementation="io.yupiik.maven.shade.transformer.PathRelocationTransformer">
                                <delegates>
                                         <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                            <resource>META-INF/faces-config.xml</resource>
                                        </transformer>
                                        </delegates>
                                </transformer>
                                <transformer implementation="io.yupiik.maven.shade.transformer.RelocationTransformer">
                                    <delegates>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                            <resource>META-INF/primefaces-p.taglib.xml</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/ajaxstatus/ajaxstatus.js</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/core.js</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/core/core.js</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/core/core.ajax.js</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/core/core.csp.js</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/validation/validation.js</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/validation/validation.bv.js</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/fileupload/fileupload.js</resource>
                                        </transformer>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                            <resource>META-INF/resources/primefaces/lifecycle/lifecycle.js</resource>
                                        </transformer>
                                    </delegates>
                                </transformer>
                            </transformers>
                            <artifactSet>
                                <includes>
                                    <include>${project.groupId}:${project.artifactId}</include>
                                </includes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>http://java.sun.com/xml/ns/javaee</pattern>
                                    <shadedPattern>https://jakarta.ee/xml/ns/jakartaee</shadedPattern>
                                    <rawString>true</rawString>
                                </relocation>
                                <relocation>
                                    <pattern>javax.faces</pattern>
                                    <shadedPattern>jakarta.faces</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.el</pattern>
                                    <shadedPattern>jakarta.el</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.annotation</pattern>
                                    <shadedPattern>jakarta.annotation</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.servlet</pattern>
                                    <shadedPattern>jakarta.servlet</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.persistence</pattern>
                                    <shadedPattern>jakarta.persistence</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.enterprise</pattern>
                                    <shadedPattern>jakarta.enterprise</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.xml.bind</pattern>
                                    <shadedPattern>jakarta.xml.bind</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.validation</pattern>
                                    <shadedPattern>jakarta.validation</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.inject</pattern>
                                    <shadedPattern>jakarta.inject</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.activation</pattern>
                                    <shadedPattern>jakarta.activation</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.ws.rs</pattern>
                                    <shadedPattern>jakarta.ws.rs</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.jws</pattern>
                                    <shadedPattern>jakarta.jws</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.cache</pattern>
                                    <shadedPattern>jakarta.cache</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.xml.ws</pattern>
                                    <shadedPattern>jakarta.xml.ws</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.xml.soap</pattern>
                                    <shadedPattern>jakarta.xml.soap</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>window.jsf</pattern>
                                    <shadedPattern>window.faces</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>jsf.ajax</pattern>
                                    <shadedPattern>faces.ajax</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>

@rmannibucau
Copy link
Contributor

@melloware can you run with -e to see the shade stack?

@melloware
Copy link
Contributor Author

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (jakarta) on project primefaces: Error creating shaded jar: Problem shading JAR C:\dev\primefaces\primefaces-melloware\primefaces\target\primefaces-12.0.0-SNAPSHOT.jar entry META-INF/MANIFEST.MF: java.lang.NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (jakarta) on project primefaces: Error creating shaded jar: Problem shading JAR C:\dev\primefaces\primefaces-melloware\primefaces\target\primefaces-12.0.0-SNAPSHOT.jar entry META-INF/MANIFEST.MF: java.lang.NullPointerException
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating shaded jar: Problem shading JAR C:\dev\primefaces\primefaces-melloware\primefaces\target\primefaces-12.0.0-SNAPSHOT.jar entry META-INF/MANIFEST.MF: java.lang.NullPointerException
    at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute (ShadeMojo.java:607)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.io.IOException: Problem shading JAR C:\dev\primefaces\primefaces-melloware\primefaces\target\primefaces-12.0.0-SNAPSHOT.jar entry META-INF/MANIFEST.MF: java.lang.NullPointerException
    at org.apache.maven.plugins.shade.DefaultShader.shadeJars (DefaultShader.java:201)
    at org.apache.maven.plugins.shade.DefaultShader.shade (DefaultShader.java:108)
    at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute (ShadeMojo.java:463)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException
    at java.util.regex.Pattern.<init> (Pattern.java:1426)
    at java.util.regex.Pattern.compile (Pattern.java:1068)
    at java.lang.String.replaceFirst (String.java:2081)
    at org.apache.maven.plugins.shade.relocation.SimpleRelocator.relocateClass (SimpleRelocator.java:208)
    at io.yupiik.maven.shade.transformer.RelocationTransformer.relocate (RelocationTransformer.java:88)
    at io.yupiik.maven.shade.transformer.RelocationTransformer.processResource (RelocationTransformer.java:64)
    at org.apache.maven.plugins.shade.DefaultShader.resourceTransformed (DefaultShader.java:550)
    at org.apache.maven.plugins.shade.DefaultShader.shadeSingleJar (DefaultShader.java:248)
    at org.apache.maven.plugins.shade.DefaultShader.shadeJars (DefaultShader.java:196)
    at org.apache.maven.plugins.shade.DefaultShader.shade (DefaultShader.java:108)
    at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute (ShadeMojo.java:463)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

@rmannibucau
Copy link
Contributor

hmm, looks like RelocationTransformer is not compatible with rawString, can you try to move to source one for this one (and keep path one first)?

@melloware
Copy link
Contributor Author

I apologize i am not quite sure what you mean? I was hoping the relocations could be declared per transformer but I don't think they can?

@rmannibucau
Copy link
Contributor

rmannibucau commented Mar 16, 2022

<transformer implementation="io.yupiik.maven.shade.transformer.SourceRelocationTransformer">

@melloware
Copy link
Contributor Author

OK I assumed this is what you mean move ManifestResourceTransformer out to its own SourceRelocationTransformer but I get the exact same stack trace.

<transformers>
	<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
	<transformer implementation="io.yupiik.maven.shade.transformer.PathRelocationTransformer">
		<delegates>
			<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
				<resource>META-INF/faces-config.xml</resource>
			</transformer>
		</delegates>
	</transformer>
	<transformer implementation="io.yupiik.maven.shade.transformer.SourceRelocationTransformer">
		<delegates>
			<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
		</delegates>
	</transformer>

@rmannibucau
Copy link
Contributor

@melloware can you push the project somewhere?

@melloware
Copy link
Contributor Author

melloware commented Mar 16, 2022

Yeah just clone https://github.com/primefaces/primefaces

Then you will find our current shading in cd /primefaces directory.

You can run mvn clean package -Pquick to build the JAR quickly and it builds a -jakarta version of the JAR with the shader with all these replacements. That is what I am trying to update it is the faces-confg.xml, beans.xml and taglib.xml to all have their proper Jakarta schemas etc.

@rmannibucau
Copy link
Contributor

@melloware guess you hit apache/maven-shade-plugin#123, it is a bug which affects the manifest transformer and more generally transformers using relocateClass without protection, did you try to not use it (maybe a plain text transformer or alike just to test)? I will add to this project the protection but manifest transformer will have the bug until shade plugin is re-released.

@melloware
Copy link
Contributor Author

awesome work @rmannibucau i am monitoring that ticket and PR. I think we need the Manifest transformer since all the classes for Java 9 modules get listed in the manifest for the Felix bundler and must be converted from javax. to jakarta. so I think I just have to wait until that SHADE bug is fixed.

@rmannibucau
Copy link
Contributor

@melloware well if it is just about replacing in manifest, any passthrough transformer would work and it would enable to workaround current maven-shade-plugin limitation

@melloware
Copy link
Contributor Author

Sorry I am definitely no expert in this but if I pull the ManifestTransformer out I just hit the next error:

 primefaces: Error creating shaded jar: Problem shading JAR C:\dev\primefaces\primefaces-melloware\primefaces\target\primefaces-12.0.0-SNAPSHOT.jar entry META-INF/resources/primefaces/core.js: java.lang.NullPointerException

@rmannibucau
Copy link
Contributor

@melloware idea was to use workaround by replacing ManifestTransformer by another transformer where relocation of the wrapper would work and wouldn't conflict with the bug in the relocation of the transformer itself. Now if shade patch works for you I guess there is no need to investigate this option too if nothing urges.

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