Question

Is there any way to create an empty update site repo for Eclipse?

I'm currently working on a product that's being tested and I'd like to be able to have an update site automatically added to the available software sites as enabled.

If I do this then the user gets an error telling him that no repository was found at that location.

Is there any way to have a repository there that doesn't contain any updates? Can I just place an empty content.xml and artifact.xml?

Was it helpful?

Solution 2

In order to avoid any messages that the update page does not exists, I have created a dummy update site containing site.xml, artifacts.jar and content.jar

I have uploaded an archive with the dummy files here.

For those not trusting enough, the code for site.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<site>

   <feature>

   </feature>
   <category-def>

   </category-def>
</site>

The code for artifacts.xml, which is contained in the artifacts.jar archive is:

<?xml version='1.0' encoding='UTF-8'?>
<?artifactRepository version='1.1.0'?>
<repository name='${p2.artifact.repo.name}' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'>
  <properties size='2'>
    <property name='p2.timestamp' value='1305295295102'/>
    <property name='p2.compressed' value='true'/>
  </properties>

</repository>

And finally, the contents of content.xml (from the content.jar file) is:

<?xml version='1.0' encoding='UTF-8'?>
<?metadataRepository version='1.1.0'?>
<repository name='${p2.metadata.repo.name}' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'>
  <properties size='2'>
    <property name='p2.timestamp' value='1305295295368'/>
    <property name='p2.compressed' value='true'/>
  </properties>
</repository>

OTHER TIPS

If you have a p2 composite site 1 and need to bootstrap it with multiple empty sites (before they are all built), you might want something like this:

now=`date +%s000`
webserver=user@domain:/web/server/path

cd /tmp
for d in component1 component2 component3 component4; do
echo "== ${f}/${d} =="
mkdir -p ${d}/all/repo/
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > ${d}/all/repo/site.xml
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > ${d}/all/repo/artifacts.xml
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > ${d}/all/repo/content.xml
echo "<site><description>Placeholder for ${d} site</description><feature></feature><category-def></category-def</site>" >> ${d}/all/repo/site.xml
echo "<?artifactRepository version='1.1.0'?><repository name='${d}.site' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'><properties size='2'><property name='p2.timestamp' value='${now}'/><property name='p2.compressed' value='true'/></properties></repository>" >> ${d}/all/repo/artifacts.xml
echo "<?metadataRepository version='1.1.0'?><repository name='${d}.site' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'><properties size='2'><property name='p2.timestamp' value='${now}'/><property name='p2.compressed' value='true'/></properties></repository>" >> ${d}/all/repo/content.xml
rsync -zrlt --rsh=ssh --protocol=28 ${d}/* ${weberver}/${f}/${d}/
done
cd ..
done

1 [http://download.jboss.org/jbosstools/builds/staging/composite/core/trunk/]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top