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

JAR has OS specific path separators #16

Open
Lynorics opened this issue Apr 17, 2014 · 5 comments
Open

JAR has OS specific path separators #16

Lynorics opened this issue Apr 17, 2014 · 5 comments
Labels

Comments

@Lynorics
Copy link

The temporary JAR created by jspc (or the FileUtilJar) seems to embed (or return) OS specific path separators.

In Class TldLocations, line 439 there is the following condition:
if (entryName.startsWith("META-INF/") &&

In my case entryName is "META-INF\blueprint.tld"

For this, the condition will never be true, the jspc breaks with an exception. :-(

Is there a workaround/solution to solve the problem?

I'm running on Windows Vista.

@Lynorics
Copy link
Author

Seems, the follwing lines of code from CompileMojo, line 132, leads to the problem. On Windows, the resulting "name" conatins backslashes, not slashes. :-\

            // Add entry
            String name = file.getAbsolutePath().substring(pathLength);
            JarEntry jarFile = new JarEntry(name);

I suggest to replace "File.separator"s always by slashes.

@Lynorics
Copy link
Author

The following line does the trick, as expected:

            name = name.replace(File.separator, "/");

@ChristianMurphy
Copy link
Member

It would probably be safer to use Java's built-in path comparison operations.

@ChristianMurphy
Copy link
Member

@Lynorics would you be able to open a pull request resolving this?

@ChristianMurphy
Copy link
Member

Hey there! 👋

Thanks for opening an issue with jspc-maven-plugin. 👍 🙇‍♂️
At the moment, the jspc maven plugin does not have an active maintainer to process your request. ⛔
While the Jasig jspc maven plugin is without an active maintainer, we recommend the Apache Sling jspc maven plugin and the Jetty jspc maven plugin as alternatives that are actively maintained. ✅
If you are interested in becoming a project maintainer, there is a uPortal-dev list post where you can register your interest. 📧

Thanks again for contributing to the jspc-maven-plugin! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants