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

cannot use resource wildcards for the same classpath in multiple JARs #593

Open
GoogleCodeExporter opened this issue Mar 24, 2015 · 14 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create 2 JARs with resources at the same path - i.e. assets/css/
2. Create an application with wro4j that includes the JARs, and configure a 
group with a wildcard for the identical path - i.e. 
<css>classpath:assets/css/**.css</css>
3. Retrieve the group's generated CSS

What is the expected output? What do you see instead?

Expect to see the CSS from both JARs in the output, instead only see the CSS 
from the first JAR matched.

What version of the product are you using? On what operating system?

v1.5.0
OSX

Please provide any additional information below.

https://groups.google.com/forum/?fromgroups=#!topic/wro4j/MPCpyAnUbz4

Original issue reported on code.google.com by chad.san...@unboundid.com on 22 Oct 2012 at 10:50

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 23 Oct 2012 at 1:57

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Is there anybody willing to contribute with a fix for this issue? 

Original comment by alex.obj...@gmail.com on 30 Nov 2012 at 8:24

@GoogleCodeExporter
Copy link
Author

Here is a quick workaround for issue. Its very hacky, but works.
I hope you will find a way to properly implement it in core.

The root problem to implement it properly is the fact that api always work with 
single file/jar.
In our case the problem is here:
WildcardStreamLocator#InputStream locateStream(final String uri, final File 
folder)

Also, group resource may be expanded only once, and cant work in "apend" way.

MultiJarClasspathUriLocator is almost a copy of ClasspathUriLocator, but it use
getClass().getClassLoader().getResources(fullPath); 
to resolve all affected jars. 
It supplies MultiFile instead of simple File into stream locator, which simply 
holds few files instead of one.
Also, default JarWildcardStreamLocator is substituted with 
MultiJarWildcardStreamLocator, which can work with multiply jars (knows about 
MultiFile).

This code may be used without library modification, just compile and add to 
classpath. New locator will be registered under classpath2 alias. To make it 
work just set it in priority with property:
uriLocators=servletContext,uri,classpath2

Original comment by vya...@gmail.com on 20 Mar 2013 at 5:06

Attachments:

@GoogleCodeExporter
Copy link
Author

Thank you very much. I'll take a look to your implementation and hopefully will 
add it to the core for next release.

Original comment by alex.obj...@gmail.com on 20 Mar 2013 at 5:13

  • Added labels: Milestone-Release-1.6.4

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 28 May 2013 at 8:11

  • Added labels: Milestone-Release-1.6.5
  • Removed labels: Milestone-Release-1.6.4

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 28 May 2013 at 9:04

  • Added labels: Milestone-Release-1.6.4
  • Removed labels: Milestone-Release-1.6.5

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 8 Jun 2013 at 9:41

  • Added labels: Milestone-Release-1.7.1
  • Removed labels: Milestone-Release-1.6.4

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 13 Sep 2013 at 3:53

  • Added labels: Milestone-Release-1.7.2
  • Removed labels: Milestone-Release-1.7.1

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 5 Nov 2013 at 1:54

  • Added labels: Milestone-Release-1.7.3
  • Removed labels: Milestone-Release-1.7.2

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 8 Jan 2014 at 3:12

  • Added labels: Milestone-Release-1.7.4
  • Removed labels: Milestone-Release-1.7.3

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 21 Mar 2014 at 9:20

  • Added labels: Milestone-Release-1.7.5
  • Removed labels: Milestone-Release-1.7.4

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 8 Apr 2014 at 9:56

  • Added labels: Milestone-Release-1.7.6
  • Removed labels: Milestone-Release-1.7.5

@GoogleCodeExporter
Copy link
Author

Original comment by alex.obj...@gmail.com on 18 Jun 2014 at 11:06

  • Added labels: Milestone-Candidate
  • Removed labels: Milestone-Release-1.7.6

@bkmeneguello
Copy link

Is this abandoned?

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

No branches or pull requests

3 participants