I found this fragment:
if (targetFile != null &&
project.getPackaging().equals("karaf-assembly")) {
serverName = targetFile.getName();
} else {
serverName = artifact.getArtifactId() + "-" + artifact.getVersion();
}
Means that target file is only honored when the pom packaging is
‘karat-assembly’ which greatly limits the plugin.
Is there any strong reason for this? Why not honor the targetFile property in
all cases?
Best regards,
Alex soto
> On Apr 21, 2016, at 12:56 PM, Morgan Hautman <[email protected]> wrote:
>
> Hi Alex,
>
> Take a look at the code here
> https://github.com/apache/karaf/tree/master/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling
>
> There is an "AssemblyMojo" & a ArchiveMojo (the 2 ones you use).
>
> There are all the parameters defined for a specific goal, with sometimes some
> comments on the parameter.
>
> I hope this help you clarify it a bit.
>
> Regards,
> Morgan
>
> PS: JB is away (travel) so he may not immediately respond if you need his
> knowledge.
>
> On 2016-04-21 17:10, Alex Soto wrote:
>> Not having any luck here!!
>>
>> Changed pom packaging to ‘pom’ and configured both goals ‘assembly’ and
>> ‘archive’ as separate executions:
>>
>> <plugin>
>> <groupId>org.apache.karaf.tooling</groupId>
>> <artifactId>karaf-maven-plugin</artifactId>
>> <executions>
>> <execution>
>> <id>gen-assembly-la1</id>
>> <phase>prepare-package</phase>
>> <goals>
>> <goal>assembly</goal>
>> </goals>
>> <configuration>
>> <classifier>la1</classifier>
>>
>> <resourcesDir>${project.build.directory}/la1/resources</resourcesDir>
>>
>> <targetServerDirectory>${project.build.directory}/la1/assembly</targetServerDirectory>
>>
>>
>> Both the <resourcesDir> and <targetServerDirectory> are ignored.
>>
>> Then on the archive goal:
>>
>> <execution>
>> <id>package-la1</id>
>> <phase>package</phase>
>> <goals>
>> <goal>archive</goal>
>> </goals>
>> <configuration>
>>
>> <classifier>la1</classifier>
>>
>> <archiveTarGz>true</archiveTarGz>
>>
>> <archiveZip>false</archiveZip>
>>
>> <targetFile>${project.artifactId}-${project.version}-la1</targetFile>
>> </configuration>
>> </execution>
>>
>> It also ignores the <targetFile> configuration. This should’t be that hard,
>> what’s going on? Any help?
>>
>> Best regards,
>> Alex soto
>>
>>
>>> On Apr 20, 2016, at 4:14 PM, Alex Soto <[email protected]> wrote:
>>>
>>> Is there a good example? The one in the Karaf documentation page does not
>>> address this scenario, which is not uncommon; usually you will need
>>> different settings for each environment (DEV, TEST, UAT, PROD, etc.,) so
>>> cloning the project is not a practical approach. I tried with profiles but
>>> that too is not very practical, since you have build the same project
>>> multiple times, and the resulting archives are not deployed correctly to
>>> the Maven repository.
>>>
>>>
>>>> On Apr 20, 2016, at 11:03 AM, Alex Soto <[email protected]> wrote:
>>>>
>>>> Thank you JB,
>>>>
>>>> Which goal should I use?
>>>>
>>>>
>>>> Best regards,
>>>> Alex Soto
>>>>
>>>>
>>>>> On Apr 20, 2016, at 10:18 AM, Jean-Baptiste Onofré <[email protected]>
>>>>> wrote:
>>>>>
>>>>> Hi Alex
>>>>>
>>>>> Using execution with the goal should do the trick (instead of just plugin
>>>>> definition).
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>>
>>>>> -------- Original message --------
>>>>> From: Alex Soto <[email protected]>
>>>>> Date: 20/04/2016 15:19 (GMT+01:00)
>>>>> To: [email protected]
>>>>> Subject: karaf-maven-plugin multiple outputs with classifiers
>>>>>
>>>>> Hello,
>>>>>
>>>>> I am trying (unsuccessfully) to us the 'karaf-maven-plugin’ to generate
>>>>> multiple archives from the same pom, using classifiers and executions.
>>>>>
>>>>> I have something like this:
>>>>>
>>>>>
>>>>> <plugin>
>>>>> <groupId>org.apache.karaf.tooling</groupId>
>>>>> <artifactId>karaf-maven-plugin</artifactId>
>>>>> <configuration>
>>>>> <bootFeatures>
>>>>> <feature>wrap</feature>
>>>>> <feature>aries-blueprint</feature>
>>>>> <feature>shell</feature>
>>>>> <feature>shell-compat</feature>
>>>>> <feature>feature</feature>
>>>>> <feature>jaas</feature>
>>>>> <feature>ssh</feature>
>>>>> <feature>management</feature>
>>>>> <feature>bundle</feature>
>>>>> <feature>config</feature>
>>>>> <feature>deployer</feature>
>>>>> <feature>diagnostic</feature>
>>>>> <feature>feature</feature>
>>>>> <feature>instance</feature>
>>>>> <feature>kar</feature>
>>>>> <feature>log</feature>
>>>>> <feature>package</feature>
>>>>> <feature>service</feature>
>>>>> <feature>system</feature>
>>>>> </bootFeatures>
>>>>> </configuration>
>>>>> <executions>
>>>>> <execution>
>>>>> <id>la1</id>
>>>>> <configuration>
>>>>> <classifier>la1</classifier>
>>>>> <resourcesDir>${project.build.outputDirectory}/la1</resourcesDir>
>>>>> </configuration>
>>>>> </execution>
>>>>> <execution>
>>>>> <id>la2</id>
>>>>> <configuration>
>>>>> <classifier>la2</classifier>
>>>>> <resourcesDir>${project.build.outputDirectory}/la2</resourcesDir>
>>>>> </configuration>
>>>>> </execution>
>>>>> </executions>
>>>>> </plugin>
>>>>>
>>>>>
>>>>> The difference between the two archives is in the resources, so I am
>>>>> specifying different ‘resourcesDir’ paths for each. The list of boot
>>>>> features will be the same for both executions, so I put it in the general
>>>>> configuration section of the plugin.
>>>>>
>>>>> When built, I am only getting a single archive output.
>>>>> Is it possible to do this with the 'karaf-maven-plugin’ plugin?
>>>>>
>>>>> Best regards,
>>>>> Alex soto
>>>>>
>>>>>
>>>>>
>>>>>
>