Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352967

Summary: jboss-har dependencies ignored
Product: z_Archived Reporter: bere
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Sample emonstrating problem none

Description bere CLA 2011-07-25 02:45:47 EDT
Build Identifier: 20100218-1602 and others

Hi,

it does also happen on XP and in other later Eclipse versions.

jboss-har dependencies (jboss-packaging-maven-plugin) are not resolved under the 'Maven Dependencies' section in eclipse projects. Also, although being displayed as a dependency in the 'Dependencies' and 'Dependency Hierarchy' tabs of the pom view, Eclipse can't resolve it.

The project builds under maven but this makes autocompletion fail, all imports are marked as error, many other error, etc. The dependency can't be resolved by Eclipse.

Reproducible: Always

Steps to Reproduce:
1. Create an EAR with a HAR dependency using the jboss-packaging-maven-plugin
2. Make sure it builds under maven
3. The HAR project will not be recognized as a dependency
Comment 1 Igor Fedorenko CLA 2011-07-25 04:29:59 EDT
please attach complete standalone project that demonstrates the problem.
Comment 2 bere CLA 2011-07-25 06:37:31 EDT
Created attachment 200264 [details]
Sample emonstrating problem

This file is a sample where you can see:

- The EAR has a dependency on the HAR and the JAR. The JAR is resolved but the HAR does not get resolved, so it will not diplay under the 'Maven Dependencies'.
- The JAR depends on the HAR also. It does not get resolved here either.
- Any code placed in the HAR is unaccessible for eclipse, although maven will compile ok.
Comment 3 Igor Fedorenko CLA 2011-07-26 01:44:39 EDT
bugsampleJAR does not "know" anything about packaging=jboss-har and cannot resolve dependency on bugsampleHAR because of that. Command line maven behaves the same if you run "mvn clean install" or similar for bugsampleJAR project only. The solution is to move jboss-packaging-maven-plugin build extension to the parent pom.

The reason the aggregator build works on command line is actually a bug in Maven, which apparently "leaks" packaging type definition between different module projects.
Comment 4 bere CLA 2011-07-26 02:19:01 EDT
You are absolutely right, spot on.

I spent a hell lot of time looking into that and googling around to find nothing about it.

Thanks for your time.
Comment 5 Denis Roy CLA 2021-04-19 13:25:20 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/