Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Classpath problems

src/main/resources directory is not on project compile classpath during
command line build, so I believe "m2e updates my classpathentry in
accordance with what I've specified in the POM" describes m2e
behaviour.

--
Regards,
Igor

On 2013-04-12 11:08 AM, Thomas Hallgren wrote:
Hi,

m2e changes my classpath in ways that I would like to avoid and I would
like some hints on how to avoid it.

I have a folder named src/main/resources where I keep a couple of
non-java files. I expect those files to be copied to the target/classes
folder and included in the jar. With m2e installed, this works just fine
(the m2e builder takes care of this), but when m2e isn't installed, the
build fails. The reason is that m2e keeps changing this line in the
.classpath file from:

     <classpathentry kind="src" output="target/classes"
path="src/main/resources"/>

into:

     <classpathentry including="**/*.java" kind="src"
output="target/classes" path="src/main/resources"/>

so of course, anyone using the project in an IDE where m2e is not
installed will now get errors when trying to run. Please note that the
classpathentry does not have a "maven.pomderived" attribute. My
expectation was that m2e would then leave it alone, but unfortunately it
doesn't.

Adding this attribute makes things even stranger. Then I get the following:

     <classpathentry excluding="**" kind="src" output="target/classes"
path="src/main/resources">
         <attributes>
             <attribute name="maven.pomderived" value="true"/>
         </attributes>
     </classpathentry>

Now instead of including "**/*.java" it decides to exclude everything.

I would like one of two scenarios, and I can live with either one:

1. m2e leaves my classpathentry alone.
2. m2e updates my classpathentry in accordance with what I've specified
in the POM.

What do I need to accomplish one of them?

Regards,
Thomas Hallgren

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top