[ http://jira.codehaus.org/browse/MRESOURCES-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=210663#action_210663 ]
Alexander Lutz commented on MRESOURCES-116: ------------------------------------------- Hi Don, now I understand the confusion. ["Filtering"|http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html] in terms of the maven-resources-plugin means: To replace quoted tokens from a "source" resource file by available Properties into the "target" resource file. Default quotations are ${...} and @...@ . The default use case looks like writing something like '${my.property}' into a resource file ..., calling mvn resources:resources -Dmy.property=xyz, resulting in: the target resource file contains 'xyz' (instead of ${my.property}). ..you think of "filtering" as "including or excluding something from the file system" (I'm OK with this formulation, but the documentation people still call it literally [Including and excluding files and directories|http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html] ;)) Except from "filtering", you solved that problem well, I think. I don't know a "better" way to copy files, though an alternative: maven-antrun-plugin and its [copy task|http://ant.apache.org/manual/CoreTasks/copy.html]. Perhaps 1-2 hints for your pom: Bind the execution rather to "process-classes" than to the "package" phase. And prefer '${project.build.directory}' to '${basedir}/target' and '${project.build.outputDirectory}' to 'target/classes'. Please also consider to close this issue! Best regards, Alex > maven-resources-plugin corrupts my class file on move > ----------------------------------------------------- > > Key: MRESOURCES-116 > URL: http://jira.codehaus.org/browse/MRESOURCES-116 > Project: Maven 2.x Resources Plugin > Issue Type: Bug > Affects Versions: 2.4.1 > Environment: Linux, jdk 1.6.0_17, maven 2.2.1 > Reporter: Don Corley > Attachments: pom.xml > > > I'm trying to create a copy of my class files and they seem to get corrupted. > I'm new to maven, so maybe I'm not understanding how it works. > To recreate this bug, create the simple maven project: > mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes > -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.0 > -DgroupId=com.example -DartifactId=zjar > Now, add this maven-resources-plugin from the > http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html > page to the pom. > Change the source directory to target/classes and the phase to package (since > I want this to run after compile) > My new pom is attached. > Now, > cd target/extra-resources > java -cp . com.example.App > gives me Incompatible magic value error. The weird thing is the class in the > target/classes directory is fine. > Thanks -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira