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

jline-terminal-jansi fails when application is shaded #366

Closed
offbynull opened this Issue Mar 12, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@offbynull
Copy link

offbynull commented Mar 12, 2019

jline-terminal-jansi uses the version value embedded in the jansi manifest to determine which version of jansi it's working with. This causes jline-terminal-jansi to fail if the application has been packaged with the maven shade plugin.

The only way to get it to work is to hack in the removed jansi manifest information back into the manifest of the final shaded JAR...

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <configuration>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <manifestEntries>
                                <Main-Class>myapp</Main-Class>
                                <Name>org/fusesource/jansi/</Name>
                                <Implementation-Version>1.17.1</Implementation-Version>
                            </manifestEntries>
                        </transformer>
                    </transformers>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <shadedClassifierName>shaded</shadedClassifierName>
                    <filters>
                        <filter>
                            <artifact>org.jline:jline</artifact>
                            <excludes>
                                <exclude>org/jline/terminal/impl/jansi/**</exclude>
                                <exclude>org/jline/terminal/impl/jna/**</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

There should be a better mechanism for getting the jansi version.

@gnodet gnodet closed this in 574271b Mar 15, 2019

@gnodet

This comment has been minimized.

Copy link
Member

gnodet commented Mar 15, 2019

This needs to be used with recent (not released yet) jansi versions to leverage fusesource/jansi@3101eeb

gnodet added a commit that referenced this issue Mar 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.