2 Replies Latest reply on Sep 10, 2009 9:27 AM by Nick Belaevski

    Maven Dependency Resource Plugin Filenames Pattern not worki

    Jason Suplizio Newbie

      This almost works as advertised except for the filenames pattern. In my experience (testing with the 3.3.0.GA, 3.3.1.GA and 3.3.2.CR1 jars) adding any wildcard pattern fails completely.


      <beforeStyleIncludes>
       <beforeStyleInclude>**/*.css</beforeStyleInclude>
      </beforeStyleIncludes>
      


      Without this functionality every developer needs to manually manage the pom by adding a relative reference to every CSS and/or JavaScript file. Of course, this can be unwieldy.

      The error thrown is included below:

      [ERROR] Error process: **/*.css
      **/*.css
      java.lang.ClassNotFoundException: **/*.css
       at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
       at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
       at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
       at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.richfaces.cdk.rd.generator.ResourcesGenerator.getResourceURL(ResourcesGenerator.java:91)
       at org.richfaces.cdk.rd.generator.ResourcesGenerator.iterate(ResourcesGenerator.java:73)
       at org.richfaces.cdk.rd.generator.ResourcesGenerator.doAssembly(ResourcesGenerator.java:57)
       at org.richfaces.cdk.rd.mojo.ResourceDependencyMojo.mergeResources(ResourceDependencyMojo.java:333)
       at org.richfaces.cdk.rd.mojo.ResourceDependencyMojo.execute(ResourceDependencyMojo.java:309)
       at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
       at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)


      Other than this problem, this is exactly what RichFaces needed.

      Enabling RichFaces compression (org.ajax4jsf.COMPRESS_STYLE) delivers the content minified/compressed.

      Any help/examples on how to correctly use filename_patterns would be greatly appreciated.

      Thanks!
      Jason