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

Bug 228406

Summary: Generator app fails if artifact repository not specified
Product: [Eclipse Project] Equinox Reporter: John Arthorne <john.arthorne>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, jeffmcaffer, pascal, simon_kaegi
Version: 3.4Flags: pascal: review+
simon_kaegi: review+
Target Milestone: 3.4 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch
none
be more resilient wrt artifact repos and publishing none

Description John Arthorne CLA 2008-04-23 09:27:50 EDT
See bug 224615 comment 16 for stack trace.  If you call the generator but don't provide the artifactRepository argument, it fails with an exception. To make it more user-friendly, it should instead just pick a default location for the artifact repository, such as on top of the source location.
Comment 1 Andrew Niefer CLA 2008-04-23 11:48:16 EDT
If we choose to put the artifact repo on top of the source location, we will probably want to set publishArtifacts = false.
Comment 2 Pascal Rapicault CLA 2008-04-23 12:59:12 EDT
We will have to be careful there because we have had bugs where the artifacts were being deleted, which is probably what Andrew eludes to bug 204060 and bug 220494
Comment 3 John Arthorne CLA 2008-04-23 15:52:19 EDT
Another option is to verify when initializing the application if there is a non-null metadata/artifact repository, and print a more helpful message to stderr stating that the repository locations are required (rather than bombing out with a stack trace).
Comment 4 Pascal Rapicault CLA 2008-04-24 23:02:44 EDT
+1 for John's approach of the message. 
Comment 5 Andrew Niefer CLA 2008-05-14 16:30:27 EDT
Created attachment 100301 [details]
patch

Patch writes and error message and exits if repos are not specified.
Comment 6 Pascal Rapicault CLA 2008-05-14 17:51:56 EDT
Reviewed and released.
Comment 7 Jeff McAffer CLA 2008-05-20 22:42:45 EDT
reopening.  the current fix breaks cases where you are generating without publishing any artifacts.  in that case there is no need to spec an artifact repo
Comment 8 Andrew Niefer CLA 2008-05-21 11:50:14 EDT
Note that even with with publishArtifacts=false we still add the artifact descriptors to the repo, we just don't copy over the jars themselves.  

There is a check against a null repo in Generator.publishArtifact, so I guess it is not strictly required.
Comment 9 Jeff McAffer CLA 2008-05-21 15:08:53 EDT
Created attachment 101344 [details]
be more resilient wrt artifact repos and publishing

if we are doing anything with publishing artifacts then require an artifact repo.
Comment 10 Jeff McAffer CLA 2008-05-22 23:11:05 EDT
need one more review.  Simon?
Comment 11 Simon Kaegi CLA 2008-05-22 23:24:20 EDT
Released.