Hi,
I am using karaf-assembly, following the documentation here :
http://karaf.apache.org/manual/latest/developers-guide/custom-distribution.html
Following you suggested solution, the result still is the same. maven
artifact name and version is used for tar.gz file.
As I mentioned in the email, the "targetFile" parameter is there and one
can specify the value for it, but this value is being ignored in the code.
Here is the code snippet from "CreateArchieveMojo.java" that I think
ignoring the "targetFile" and using the artifact Id and version to
generation the archive:
public File archive(File source, File dest, Artifact artifact) throws
IOException {
String serverName = artifact.getArtifactId() + "-" + artifact.getVersion();
dest = new File(dest, serverName + "." + artifact.getType());
Project project = new Project();
MatchingTask archiver;
if ("tar.gz".equals(artifact.getType())) {
Cheers,
On Mon Feb 02 2015 at 5:57:27 PM Jean-Baptiste Onofré <[email protected]>
wrote:
> Hi Mohammad,
>
> which goal are you using ? I guess just install-kar, right ?
>
> You have to specify the instance-create-archive goal, which take the
> result of the install-kar goal (target/assembly), and package as an
> archive (zip/tar.gz archives).
> This goal accepts a targetFile parameter.
>
> So you can do:
>
> <plugin>
> <groupId>org.apache.karaf.tooling</groupId>
> <artifactId>karaf-maven-plugin</artifactId>
> <executions>
> <execution>
> <id>process-resources</id>
> <phase>process-resources</phase>
> <goals>
> <goal>install-kars</goal>
> </goals>
> </execution>
> <execution>
> <id>package</id>
> <goals>
> <goal>instance-create-archive</goal>
> </goals>
> <configuration>
> <targetFile>my-file</targetFile>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
>
> Regards
> JB
>
> On 02/02/2015 03:06 PM, Mohammad Shamsi wrote:
> > Hi All,
> >
> > I'm using karaf-maven-plugin to create a customized distribution tar
> file.
> > The final tar.gz file name always following the artifact name. I did try
> > to use "finaName" and "targetFile" in configuration, but didn't work.
> >
> > Looking at plugin source code, it seems that it's ignoring the
> > "targetFile" parameter during archive creation.
> >
> > Is this a bug or I am missing something?
> >
> > Cheers,
>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>