Skip to main content

[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

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



On Wed, Jul 4, 2012 at 3:30 PM, Chris Rovers <crovers@xxxxxxxxx> wrote:

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>http://ournexusserver:8081/nexus/content/repositories/Virgo3.5.0.M04/</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>http://ournexusserver:8081/nexus/content/repositories/thirdparty/.meta/p2</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



Back to the top