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

Bug 315424

Summary: Documentation should mention when locations need to be specified as URLs
Product: [Eclipse Project] PDE Reporter: Stephan Herrmann <stephan.herrmann>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer
Version: 3.6   
Target Milestone: 3.6 RC4   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Stephan Herrmann CLA 2010-06-02 12:49:27 EDT
I just marvelled at this exception:

java.lang.IllegalArgumentException: Location must be absolute: /opt/public/tools/objectteams/testrun/build-root/eclipse/outputp2repo
      at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.checkValidLocation(AbstractRepositoryManager.java:737)
      at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.contains(AbstractRepositoryManager.java:249)
      at org.eclipse.equinox.p2.publisher.Publisher.loadArtifactRepository(Publisher.java:141)
      at org.eclipse.equinox.p2.publisher.Publisher.createArtifactRepository(Publisher.java:105)
      at org.eclipse.equinox.p2.publisher.AbstractPublisherApplication.initializeRepositories(AbstractPublisherApplication.java:99)
      at org.eclipse.equinox.p2.publisher.AbstractPublisherApplication.initialize(AbstractPublisherApplication.java:85)
      at org.eclipse.equinox.p2.publisher.AbstractPublisherApplication.run(AbstractPublisherApplication.java:293)
      at org.eclipse.pde.internal.build.publisher.GatherBundleTask.execute(GatherBundleTask.java:71)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

In my vocabulary that path *is* absolute!

Only a look into the sources revieled that p2.build.repo must be a URI.
This should be specified in the documentation/help.
Comment 1 Andrew Niefer CLA 2010-06-02 13:38:08 EDT
Updated the references I found for p2.build.repo, p2.metadata.repo and p2.artifact.repo, as well as docs on the pde p2 tasks to mention that they are URIs.

BTW Stephan, we are currently fixing docs for the final 3.6 Helios RC4 build this week.  So if you see any other doc problems, now is the time :)
Comment 2 Stephan Herrmann CLA 2010-06-02 14:58:06 EDT
(In reply to comment #1)
> BTW Stephan, we are currently fixing docs for the final 3.6 Helios RC4 build
> this week.  So if you see any other doc problems, now is the time :)

Looks like it's my lucky day, trying to modernize some ancient build scripts
just today :)

Here's another one right from the trenches, not sure what part missing
documentation has in my confusion:

We have customTargets.xml in the -Dbuilder= directory and the generated
assemble scripts try to call all kinds of "assemble.my.feature.config"
targets, as are documented in "allElements.xml" (not in "customTargets.xml"!)

It was not clear to me from the documentation, how adding
  p2.gathering = true
would require me to add more assemble... targets to customTargets.xml,
specifically
  "assemble.my.feature.group.group.group"
and
  "assemble.my.feature.p2"

Is that a bug in the documentation, or in the implementation or in my head?
Comment 3 Andrew Niefer CLA 2010-06-02 15:41:55 EDT
hmmm, this will be a consequence of upgrading from an old build setup.  There is no explicit docs about this.

It would be good if you could create an entry at http://wiki.eclipse.org/PDE/Build/FAQ with the error message you got and I can fill it in with an explanation.


allElements.xml is talked about a little bit at
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_customization.htm

This file was introduced in 3.2, we extracted the assemble targets into their own xml to help simplify productBuild.xml (new in 3.2).

In 3.4 we introduced a "defaultAssemble" target to the allElements.xml which removes the need to define platform specific assemble targets.

The p2.gathering does need those extra targets, but you wouldn't need to define them if the allElements file was from 3.4 or newer.


I would suggest updating to a modern customTargets.xml and allElements.xml from 3.5 or 3.6.  You only need to define specific assemble targets if you want to do some custom work there, otherwise everything just uses the default target.
Comment 4 Stephan Herrmann CLA 2010-06-02 16:45:45 EDT
(In reply to comment #3)
> hmmm, this will be a consequence of upgrading from an old build setup.  There
> is no explicit docs about this.
[...]
> allElements.xml is talked about a little bit at
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_customization.htm
> 
> This file was introduced in 3.2, we extracted the assemble targets into their
> own xml to help simplify productBuild.xml (new in 3.2).

That explains! The basic bits of our scripts are from 3.0 times, at what time
everything was still just in customTargets.xml

That's the grief with templates to copy&edit: they just get stale over time.
It would be a real treat if there were some docs on how to keep your scripts
up-to-date, actually. Otherwise you get all the complaints that old scripts
just too easily break.

> I would suggest updating to a modern customTargets.xml and allElements.xml from
> 3.5 or 3.6.  You only need to define specific assemble targets if you want to
> do some custom work there, otherwise everything just uses the default target.

I will try that. Thanks!