Jasig / jspc-maven-plugin

UNMAINTAINED Maven plugin that compiles JSPs
http://unmaintained.tech/
Apache License 2.0
24 stars 38 forks source link

JAR has OS specific path separators #16

Open Lynorics opened 10 years ago

Lynorics commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

The following line does the trick, as expected:

            name = name.replace(File.separator, "/");
ChristianMurphy commented 7 years ago

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

ChristianMurphy commented 7 years ago

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

ChristianMurphy commented 7 years ago

Hey there! :wave:

Thanks for opening an issue with jspc-maven-plugin. :+1: :bowing_man: At the moment, the jspc maven plugin does not have an active maintainer to process your request. :no_entry: 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. :white_check_mark: If you are interested in becoming a project maintainer, there is a uPortal-dev list post where you can register your interest. :email:

Thanks again for contributing to the jspc-maven-plugin! :sparkles: