I have checked now. The resource is available in target/classes of the
corresponding project, as it should. The original is in src/main/resources,
from where it was copied.
Igor Fedorenko-4 wrote:
>
> What m2e version you are using? In 0.9.6 workspace artifact resolution
> was disabled for Maven plugins executed from Eclipse builder, so m2e was
> always using maven plugins from local repository. 0.9.7 uses workspce
> plugins from Eclipse builder.
>
> Also, can you check if "my.resource" resource is actually available in
> project output folder (i.e. target/classes). There is a known problem in
> m2e with missing resources, so I wonder if this is the reason.
>
> --
> Regards,
> Igor
>
> Jochen Wiedmann wrote:
>> Hi,
>>
>> I have three Maven projects: A produces an artifact, B creates a
>> private Maven plugin, and C uses B to process the artifact created by
>> A. The plugin accesses the artifacts resources like this:
>>
>> URL url =
>> Thread.currentThread().getContextClassLoader().getResource("my.resource");
>> if (url == null) {
>> url = getClass().getClassLoader().getResource("my.resource");
>> if (url == null) {
>> throw new IOException("Resource my.resource not available");
>> }
>> }
>>
>> The POM lists the artifact A as a dependency in the plugins section of
>> dependencies. In other words, the plugin is configured like this:
>>
>> <build><plugins>
>> <plugin><artifactId>B</artifactId>
>> <dependencies><dependency>A</dependency></dependencies>
>> </plugin>
>> </plugins></build>
>>
>> This approach works fine within native Maven. Not so within M2Eclipse
>> (or, more precisely, when the Maven Project Builder is invoking the
>> plugin as a part of the Eclipse build process): The resource isn't
>> found.
>>
>> Any ideas what might be wrong?
>>
>> Thanks,
>>
>> Jochen
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>
--
View this message in context:
http://www.nabble.com/Classpath-when-running-Maven-Project-Builder-tp22177949p22199934.html
Sent from the Maven Eclipse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email