| Summary: | Dependency on sources after main artifact disables main artifact | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Alex Pogrebnyak <alex-pub.eclipse> | ||||
| Component: | m2e | Assignee: | Project Inbox <m2e.core-inbox> | ||||
| Status: | CLOSED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | igor | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Actually, with configuration that compiles java code, i.e
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier/>
</dependency>
I get an error from GWT server:
19:30:49.356 [ERROR] [applicationScaffold] Line 97: No source code is available for type javax.validation.ConstraintViolation<T>; did you forget to inherit a required module?
Created attachment 206317 [details]
working example
Using clean m2e install, the attached example properly has both both jar and sources-jar dependencies under Maven Dependencies classpath container. Most likely the problem you observed is caused by one of m2e extensions you use. If you believe the problem is cased by m2e itself, feel free to reopen this bugreport but make sure to provide complete standalone example we can use to reproduce the problem using eclipse 3.7 "for java developers" package available from download.eclipse.org
|
I am going through Spring Roo tutorial, and one of the topics is setting up GWT project. GWT requires some source files to be present as dependencies of the maven project, as such it requires javax.validation:validation-api:1.0.0.GA:sources artifact. The project already had a dependency on a main 'jar' artifact of the validation-api. After Roo modified POM and added 'sources' jar at the end of the dependencies list, I could no longer import classes from javax.validation.constraints package. In particular javax.validation.constraints.NotNull annotation. After I've rearranged dependencies, so that main artifact comes after sources, e.g. <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> <classifier>sources</classifier> </dependency> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> <classifier/> </dependency> The project compiles without errors. If I again reverse the order <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> <classifier/> </dependency> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> <classifier>sources</classifier> </dependency> the fields annotated with @NotNull show up in red.