Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] [m2eclipse-user] Resources in target/test-classes are removed

https://issues.sonatype.org/browse/MNGECLIPSE-823

Please use m2e-users@xxxxxxxxxxx mailing list for m2e user questions.

--
Regards,
Igor

On 10-11-11 08:41 AM, Abid Hussain wrote:
The observed behaviour when resources are removed from
target/test-classes and target/classes is the following.
Each "Building workspace" run takes place twice for reasons I don't understand.

The first run does everything as expected and resources are copied
properly. But allways a second run is performed directly after the
first. In this the resources are removed again (presumptive by JDT
because of the exclude=** in source folder properties).

Any ideas what's going on here?

2010/11/10 Igor Fedorenko<igor@xxxxxxxxxxxxxx>:
See my answers inline.


Also, please use m2e-users@xxxxxxxxxxx mailing list


--
Regards,
Igor


On 10-11-10 08:00 AM, Abid Hussain wrote:


[skip]


Let me ask two questions:
- Is it correct that excludes=** means everything is excluded so that
the JDT cannot interfere with the Maven resource copying process?

Yes, this is correct, excludes=** tells JDT builder to ignore resources, so
it does not interfere with Maven builder.


- And is it correct that in this case only m2eclipse is responsible
for resource copying and the Maven Builder is called at last in the
configured eclipse build process?

Yes, Maven builder is the only one responsible for processing (Maven)
resources.



Regards,

Abid


What you see is likely MNGECLIPSE-823 [1] and custom lifecycle mapping
[2] is the only solution to that problem available at the moment


[1] https://issues.sonatype.org/browse/MNGECLIPSE-823
[2] https://docs.sonatype.org/pages/viewpage.action?pageId=2949459

--
Regards,
Igor

PS: please use m2e-users@xxxxxxxxxxx mailing list


On 10-11-09 12:52 PM, Abid Hussain wrote:

Hi again,

I'm encountering a strange misbehaviour in m2eclipse 0.10.

As in pom.xml defined, several test resources in src/test/resources
are declared (to be copied to target/test-classes).

When eclipse performs "Building workspace", all resources from
src/test/resources are properly copied to target/test-classes.

But then, "Building workspace" is performed a second time (don't know
why) and all resources are removed again from target/test-classes.

This behaviour makes it impossible to run any JUnit test which depends
on any kind of resource.

Now it becomes interesting. The copying of test resources is
configured like this:
     <testResources>
       <testResource>
         <directory>src/test/resources</directory>
       </testResource>
     </testResources>

When I took a look in the Build Path properties of eclipse (Build Path
->      Configure Build Path) the file exclusion pattern of the source
folder src/test/resources was "**".

Those properties have been generated from m2eclipse I believe. When I
manually changed this property to "None", everything works fine: all
resources are copied to test-classes and aren't being removed.

My suspicion is the following: when checking out a project from SVN,
m2eclipse offers to check it out as maven project and generates all
eclipse specific files (.project, .classpath, etc.), right?

But what happens when the pom.xml is changed in future? Are the
eclipse project files are also being updated from m2eclipse?

Regards,

Abid




Back to the top