Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352154 - eclipse-repository fails to resolve Maven snaphot bundles
Summary: eclipse-repository fails to resolve Maven snaphot bundles
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Tobias Oberlies CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 342876
  Show dependency tree
 
Reported: 2011-07-14 14:40 EDT by Harald Wellmann CLA
Modified: 2021-04-28 16:55 EDT (History)
2 users (show)

See Also:


Attachments
Sample project to reproduce the problem (13.39 KB, application/x-sdlc)
2011-07-14 14:42 EDT, Harald Wellmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Wellmann CLA 2011-07-14 14:40:37 EDT
Build Identifier: Tycho 0.13.0-SNAPSHOT

With pomDependencies=consider, an eclipse-repository build fails to resolve a Maven snapshot bundle dependency. Apparently, Tycho gets confused about the SNAPSHOT vs. timestamp suffix for the p2 metadata files.

Reproducible: Always

Steps to Reproduce:
- Unpack the attached sample project.

- Use a profile which enables a snapshot repository:
  mvn -Pwicketstuff-snapshot clean install

- The build fails with this message

[INFO] --- tycho-p2-repository-plugin:0.13.0-SNAPSHOT:assemble-repository (default-assemble-repository) @ org.omadac.demo.site ---
[WARNING] Mirror tool: "Messages while mirroring artifact descriptors.": ["Artifact not found: canonical: osgi.bundle,org.wicketstuff.bundle,1.5.0.SNAPSHOT."]

- The snapshot artifact is now in the local repository, and repeating the build without the snapshot profile now succeeds:
mvn clean install

- To reproduce:
rm -fr ~/.m2/repository/org/wicketstuff/wicketstuff-bundle/1.5-SNAPSHOT/,
and start again.
Comment 1 Harald Wellmann CLA 2011-07-14 14:42:53 EDT
Created attachment 199693 [details]
Sample project to reproduce the problem
Comment 2 Tobias Oberlies CLA 2011-07-27 09:09:27 EDT
This is not nice: A build that fails the first time, but succeeds the second time. Thanks for the bug report - we'll look into it for 0.13
Comment 3 Tobias Oberlies CLA 2011-08-03 15:29:48 EDT
Fixed with 7a4b416 - a one-liner, but hard to find.

@Igor: The fix was to replace Artifact.getVersion with Artifact.getBaseVersion. Neither method has any JavaDoc - are you aware of any unwanted effects this change could have?
Comment 4 Igor Fedorenko CLA 2011-08-04 02:17:59 EDT
(In reply to comment #3)
> Fixed with 7a4b416 - a one-liner, but hard to find.
> 
> @Igor: The fix was to replace Artifact.getVersion with Artifact.getBaseVersion.
> Neither method has any JavaDoc - are you aware of any unwanted effects this
> change could have?

No, no side effects, the change is good.

For snapshots, artifact base version is always the same 1.2.3-SNAPSHOT, while version gets expanded to a new value each time new snapshot is deployed (but it is still the same for locally installed artifacts and inside reactor). For releases, version and base version are always the same.