[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [p2-dev] Setting bundles to autostart when installed through the p2 director
|
You can see the general documentation about root files
here.
What you need to do is to:
1. Go to Eclipse and switch to Plug-in Development perspective
2. File->New->Feature Project
3. Put folders under your new feature project that will contain your files: pickup_files, repository_ext_files, repository_usr_files.
4. Double-click the build.properties file, located in the same project. A nice view will come up and be sure to select your newly created folders to be included in the Binary Build.
5. Open the same file with a plain text editor and add these three lines:
root.folder.pickup=pickup_files
root.folder.repository/ext=repository_ext_files
root.folder.repository.usr=repository_usr_files
You can read more about the root.folder.<subfolder>=<path> syntax in the linked documentation above.
6. Right click on the feature project->Export->Plug-in Development/Deployable Features, fill the destination, export
7. You should now have an update site containing a feature with root files. When you install it onto a VTS the files should be placed in the respective folders.
Hope that helps,
Bobby
On Wed, Jul 4, 2012 at 5:47 PM, Chris Rovers
<crovers@xxxxxxxxx> wrote:
Aha. That's the key bit of info I was missing - that p2 provisioning only goes into the kernel region. I definitely want these bundles in the user region - there's no reason for them to be in the kernel.
Can you point me at something that indicates how to create a feature with root content? My experience with creating feature sites is pretty minimal at this point and I'm not seeing anything clear with a google search.
Thanks very much
Chris
Hi
Chris,
In
short - no. The director cannot be configured to start particular
bundles.
Just
to ensure we are on the same page - any p2 provisioning operation over VTS will
install/remove bundles only in the kernel region.
Having
that in mind here are the two possible use cases:
1.
You want your bundles installed in the kernel region along with VTS.
If
that’s the case you might want to consider using Virgo Nano Full. It also
provides web capability with the difference that your third-party bundles will
be visible to your apps without additional configuration, while with VTS you’ll
install them in the kernel region and will need to manually configure the user
region visibility to expose them.
Back
to the options:
- Probably the easiest way to do this would be to put a p2.inf
file in the META-INF directory of every bundle you want started. The p2.inf
file should contain only this line:
instructions.configure = markStarted(started: true)
- There is another way to achieve the same result without
modifying your bundles. It involves product inheritance and is more complex so
we can take a look there only if the one above doesn’t work for you.
Both
solutions are not perfect but they work. There are two enhancements opened in
bugzilla which when resolved will greatly simplify this process. You'll be able
to create a p2 feature that refers your bundles and configure them to start
from the IDE by just checking a box or directly in the feature.xml with a
single attribute. Sounds easy, eh? ;)
If
you're interested you can vote for them:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=364247
https://bugs.eclipse.org/bugs/show_bug.cgi?id=364246
2.
You want your bundles installed in the user region or dropped in pickup.
This
is a bit more Virgo-specific. In order to get your stuff to the user region you
need to create a p2 feature with root content. This is a feature which upon
installation will unzip your root content in the install destination. You can
set it up in such a way that it will unzip your bundles in VTS's
/repository/ext or /repository/usr and also unzip a plan that refers them in
/pickup so that they will get deployed upon VTS startup.
Hope that helps,
Bobby
Hi, all
I’m creating a maven pom that will automatically install Virgo Tomcat Server and all the thirdparty bundles I need using p2director. Thus far, I have p2director successfully installing VTS such that it starts up successfully, but all the bundles that I installed using p2director are set in bundles.info not to start. I’m launching p2director through eclipsec.exe
Is it possible to set this with p2director? Ideally, VTS wouldn’t be started yet when all of these bundles are installed - I’d like the first startup to be with everything installed properly.
Thanks very much.
Relevant sections of the POM is below :
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>installvirgo</id>
<phase>package</phase>
<configuration>
<executable>${ECLIPSELOC}</executable>
<workingDirectory>.</workingDirectory>
<arguments>
<argument>-application</argument>
<argument>org.eclipse.equinox.p2.director</argument>
<argument>-console</argument>
<argument>-repository</argument>
<argument>REPOSITORYURL/</argument>
<argument>-installIU</argument>
<argument>
tomcat-server.product,
com.springsource.org.apache.log4j,javax.annotation
</argument>
<argument>-tag</argument>
<argument>InitialState</argument>
<argument>-destination</argument>
<argument>${VIRGOINSTALLDIR}</argument>
<argument>-profile</argument>
<argument>VTSProfile</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
<execution>
<id>installthirdparty</id>
<phase>package</phase>
<configuration>
<executable>${ECLIPSELOC}</executable>
<workingDirectory>.</workingDirectory>
<arguments>
<argument>-application</argument>
<argument>org.eclipse.equinox.p2.director</argument>
<argument>-console</argument>
<argument>-repository</argument>
<argument>
REPOSITORYURL</argument>
<argument>-installIU</argument>
<argument>
scannotation,
activation,
httpcore,
httpclient,
javassist,
resteasy-jaxrs,
jaxrs-api,
jaxb-impl,
jaxb-api,
jackson-jaxrs,
jackson-core-asl,
jackson-mapper-asl,
resteasy-jackson-provider,
resteasy-jaxb-provider
</argument>
<argument>-tag</argument>
<argument>InitialState</argument>
<argument>-destination</argument>
<argument>${VIRGOINSTALLDIR}</argument>
<argument>-profile</argument>
<argument>VTSProfile</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev