I also noticed that the similar action is taking place in
GenerateFeaturesFileMojo.java at lines 169 and 170:
outputFile.getParentFile().mkdirs();
out = new FileOutputStream(outputFile);
Is this what the issue could be? Is anyone else having this problem?
----- Original Message -----
From: [email protected]
To: [email protected]
Sent: Monday, November 8, 2010 3:48:34 PM
Subject: Re: features-maven-plugin
This is interesting, according to my exception log, the code is failing in
GenerateFeaturesXmlMojo.execute() line 144 when creating a FileOutputStream.
This is a try-catch loop where the first item executed is:
out = new PrintStream(new FileOutputStream(outputFile));
where "outputFile" is defined (by default) as
"${project.build.directory}/classes/feature.xml"
These are listed as the reasons FileOutputStream(string File) might throw this
exception:
"if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reason".
This means that FileOutputStream can't create the file. In the "mvn clean
install" target I'm executing, the build directory is definately deleted. So,
this must be a "does not exist but cannot be created" issue, although my
compiler is able to create other directories and files... I'm stumped.
v/r,
Mike Van
----- Original Message -----
From: [email protected]
To: [email protected]
Sent: Monday, November 8, 2010 2:12:30 PM
Subject: Re: features-maven-plugin
OH, I noticed I missed the <plugin> tag. Please note this tag is present on
the item I'm attempting to build, and it generates the same error.
v/r,
Mike Van
----- Original Message -----
From: [email protected]
To: [email protected]
Sent: Monday, November 8, 2010 2:08:26 PM
Subject: features-maven-plugin
All,
I'm attempting to use the features-maven-plugin to generate a features.xml file
for my application. In keeping with how the SMX and Camel folks implement this
plugin, I've created a new project called "features" which contains only a
pom.xml file with my directives. It looks similar to this:
<project (followed by the normal maven stuff)>
<modelVersion>4.0.0</modelVersion>
<groupId>myApp</groupId>
<artifactId>features</artifactId>
<version>0.4.0-SNAPSHOT</version>
<parent>
<artifactId>myApp</artifactId>
<groupId>myApp</groupId>
<version>0.4.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<artifactid>myApp</artifactId>
<groupId>moduleOne</groupId>
<version>${pom.version}</version>
</dependency>
<dependency>
<artifactid>myApp</artifactId>
<groupId>moduleTwo</groupId>
<version>${pom.version}</version>
</dependency>
<dependency>
<artifactid>myApp</artifactId>
<groupId>moduleThree</groupId>
<version>${pom.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<groupId>org.apache.felix.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>generate-features-xml</goal>
</goals>
<configuration>
<features>
<feature>moduleOne</feature>
<feature>moduleTwo</feature>
<feature>moduleThree</feature>
</features>
<repository>target/features-repo</repository>
</configuration>
</execution>
</executions>
</plugins>
</build>
</project>
When doing a "mvn clean install", I get the following error:
Unable to create featureures.xml file: java.io.FileNotFoundException:
/home/me/myWorkspace/myApp/features/target/classes/features.xml
So, clearly I'm not doing this right. Can anyone provide some help? The plugin
itself is not documented, so I'm at a bit of a loss.
v/r,
Mike van