ops4j / org.ops4j.pax.construct

Build, manage and deploy many types of OSGi bundles
https://ops4j1.jira.com/wiki/display/paxconstruct/Pax+Construct
24 stars 14 forks source link

maven-pax-plugin always uses all artifacts produced by multimodule projects [PAXCONSTRUCT-114] #127

Open ops4j-issues opened 15 years ago

ops4j-issues commented 15 years ago

Richard Wallace created PAXCONSTRUCT-114

I have a project with a structure like

catalog/pom.xml
api/pom.xml
core/pom.xml
rest/pom.xml
ui/pom.xml

I'd like to be able to configure the rest and ui modules to run the pax:run goal in the pre-integration-test phase, do their own integration tests, and then stop the framework. Problem is, when I configure the rest/pom.xml with

      <plugin>
        <groupId>org.ops4j</groupId>
        <artifactId>maven-pax-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <id>start-framework</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <framework>felix</framework>
              <noDependencies>true</noDependencies>
              <provision>
                <provision>mvn:org.ops4j.pax.web/pax-web-service/${pax.web.version}</provision>
              </provision>
            </configuration>
          </execution>
        </executions>
      </plugin>

it always includes all the bundles produced by the multimodule project, including api, core and ui. I don't really want the ui bundle installed in this situation.


Affects: 1.4 Fixed in: 1.7.0 Votes: 0, Watches: 0

ops4j-issues commented 15 years ago

Stuart McCulloch commented

Target for 1.5

ops4j-issues commented 13 years ago

Andreas Pieber commented

I' ve a similar issue. Not exactly the same, but I also want that some bundles do not start with pax:provision, although they're in the modules section of the pom. I've tried to fix this adding the following code:

/**

public void execute()
throws MojoExecutionException
{
m_bundleIds = new ArrayList();

if( deployPoms != null )

{ addAdditionalPoms(); }

for( Iterator i = m_reactorProjects.iterator(); i.hasNext(); )
{
MavenProject project = (MavenProject) i.next();
boolean shouldIgnore = false;
for (int j = 0; j < ignores.length; j++)

{ String ignore = ignores[j]; String[] artifact = ignore.split(":"); shouldIgnore = project.getArtifact().equals(artifact[1]) && project.getGroupId().equals(artifact[0]); }

if (!shouldIgnore)

{ addProjectBundles(project, false == noDependencies); }

}

setupRuntimeHelpers();

deployBundles();
}

I'm sure that's not the best method, but basically it should do the work. BUT I always get the following error: Any ideas what I do wrong?

ERROR BUILD ERROR
INFO ------------------------------------------------------------------------
INFO Failed to configure plugin parameters for: org.ops4j:maven-pax-plugin:1.4

(found static expression: '{$ignores}' which may act as a default value).

Cause: Cannot assign configuration entry 'ignores' to 'class [Ljava.lang.String;' from '{$ignores}', which is of type class java.lang.String