You're absolutely right and a boolean parameter (something like skipAddResource) would be sufficient for our purposes.
My intentions were in no way to alter the default behaviour. I can provide you with another patch, if need be. Am 13. August 2010 15:47 schrieb Matthias Weßendorf (JIRA) < [email protected]>: > > [ > https://issues.apache.org/jira/browse/TRINIDAD-1852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12898237#action_12898237] > > Matthias Weßendorf commented on TRINIDAD-1852: > ---------------------------------------------- > > the default behavior is that project.addResource(resource); is called. > > with your parameter, it is no longer called. Why would we want to change > that behavior? > I am fine with having a parameter, we should not change the default > behavior > > > Maven Javascript Plugin: ends up in a packaging loop > > ---------------------------------------------------- > > > > Key: TRINIDAD-1852 > > URL: https://issues.apache.org/jira/browse/TRINIDAD-1852 > > Project: MyFaces Trinidad > > Issue Type: Improvement > > Components: Plugins > > Affects Versions: 2.0.1-plugins > > Reporter: Michael Velimirov > > Assignee: Matthias Weßendorf > > Priority: Minor > > Attachments: ReduceJavascriptMojo.patch > > > > > > The functionality your plugin provides was exactly what we were looking > for. > > Except for a small issue we encountered where the contents of the > targetDirectory-directive would be added to the > > source-jar (invoked by the addResource-Method). > > Because we provide a slightly unusual targetDirectory-directive(to > automate the inclusion of optimized javascript files), the source packaging > process(subprocess of maven-source-plugin) > > eventually ends up in a packaging loop, provoked by the source file > > being opened for writing to and reading from in parallel. > > I've attached a patch solving the problem by omitting the inclusion of > the targetDirectory if you set addResource to false. > > This is our current maven configuration (pom.xml) > > <plugin> > > <groupId>org.apache.myfaces.trinidadbuild</groupId> > > <artifactId>maven-javascript-plugin</artifactId> > > <configuration> > > <sourcePath>./javascript</sourcePath> > > > <sourceDirectory>src/main/webapp/resources</sourceDirectory> > > <targetPath>./debug/javascript</targetPath> > > > <targetDirectory>${project.build.directory}</targetDirectory> > > > <optimizeTargetPath>./${project.artifactId}-${project.parent.version}/resources/javascript</optimizeTargetPath> > > </configuration> > > <executions> > > <execution> > > <phase>process-resources</phase> > > <goals> > > <goal>reduce-javascript</goal> > > </goals> > > </execution> > > </executions> > > </plugin> > > <plugin> > > <groupId>org.apache.maven.plugins</groupId> > > <artifactId>maven-war-plugin</artifactId> > > <configuration> > > <warSourceExclude>*javascript/*.js</warSourceExclude> > > </configuration> > > </plugin> > > If you need additional information, let me know. > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > >
