Post

1 follower Follow
1
Avatar

Packaging a folder using the Deployit Maven plugin

Hi,

 

I'm trying the deployIt maven plugin and i don't understand how works the location properties.

The doc says it's relative to the dar project.

Here's the plugin section of the pom.xml

    <build>

        <plugins>

            <plugin>

                <groupId>com.xebialabs.deployit</groupId>

                <artifactId>maven-deployit-plugin</artifactId>

                <version>3.8.5</version>

                <extensions>true</extensions>

                <configuration>

                    <deployable>

                        <name>Reference</name>

                        <type>file.Folder</type>

                        <location>target/classes</location>

                    </deployable>

                </configuration>

            </plugin>

        </plugins>

    </build>
I tried several paths for the location properties with no success. The dar is created but it only contains the Manifest,

BR,

John

Jonathan Piron

Please sign in to leave a comment.

10 comments

0
Avatar

Hi John

This should hopefully be an easy one: it looks like you're missing a

<deployables>

  ...

</deployables>

section around your <deployable> :-) With that change your sample POM worked for me. See the following example in the documentation.

Hope this helps!

Andrew

XebiaLabs

XebiaLabs Support 0 votes
0
Avatar

Thanks !

I think I need to clean my glasses :)

with this working i can go further and now i'd like to override the CI-Application property and the Name property of the generated manifest.

By default, the CI-Application property is set to the artefactId and the Name property for a file.Folder is set to the folder name.

Is there a way to override this default behaviour ?

BR,

John

Jonathan Piron 0 votes
0
Avatar

By default, the CI-Application property is set to the artefactId and the Name property for a file.Folder is set to the folder name.

If you look at the generated manifest, the Name property will indeed be the name of the folder; that's required by the JAR format specification.

Deployit, however, uses the CI-Name property to determine the name of the deployable when importing the package; you should be able to specify this by the <name>...</name> tag as in your example. See the packaging manual for more information.

Does your manifest contain a section like:

Name: classes

Type: file.Folder

CI-Name: Reference

?

Setting the CI-Application property to a value different from the artifact ID is currently an open feature request. Are you packaging the DAR as part of an EAR or WAR build (i.e. one with <packaging>ear</packaging> or <packaging>war</packaging>) or do you have a separate build for the DAR (<packaging>dar</packaging>).

If you have a separate DAR build, is there anything that would prevent you from setting the artifactId for that build to the CI-Application property that you're trying to use?

Regards

Andrew

XebiaLabs

XebiaLabs Support 0 votes
0
Avatar

Hi,

Ok for the name I didn't know it was a JAR format specification. Yes, indeed, I've set the CI-Name to what I need.

I'm packaging the DAR as part of a JAR build. The resources of this build are filtered with a maven profile so I'd like to add this profile ID to the CI-Application to act as a classifier.

Is there a release date for this feature ?

Jonathan Piron 0 votes
0
Avatar

Hi,

 I saw the release of Deployit Maven plugin 3.8.6 but, according to the changelog, it doesn't seem to bring the feature of setting the CI-Application property to a value different from the artifact ID.

Is there any release date for this feature ?

 BR,

 John

Jonathan Piron 0 votes
0
Avatar

Hi John

Is there any release date for this feature ?

This is currently still on the list. Once Deployit 3.9 is released in the coming weeks, we'll be reviewing these kind of improvement requests to make a selection for the next version. Your vote for this feature has been noted! ;-)

Regards

Andrew

XebiaLabs

PS: If this is critical or presenting a significant business challenge to you please indicate that, as it will help us correctly prioritize requests. Thanks!

XebiaLabs Support 0 votes
0
Avatar

Hi,

I wouldn't say it's critical but we're really expecting this feature as it would significantly improve our deployment process.

We use maven profiles to generate specific environment artifacts (typically configuration artifacts). All those generated artifacts indeed use classifiers.

Currently we are dealing with this using homemade scripts which kind of break our deployment process.

Having this feature implemented would allow us to import/deploy those artifacts directly from maven and thus, get ride of those homemade scripts.

Regards,

John

Jonathan Piron 0 votes
0
Avatar

Hi Jonathan,

If you create a separate Maven project (POM) with the packaging dar, you can give that a different name from the name of the jar project. The dar project would have a dependency on the jar project and would  package it (along with the file.Folder deployable) into a DAR and optionally import and deploy it.

Would that work for you?

Regards, Vincent.

XebiaLabs Support 0 votes
0
Avatar

Hi,

We would have to create many new POMs for this to work. Moreover, we'd like to deploy artifacts when they are built. Using a different POM, we'd have to build this specific POM to get the artifact deployed. As we're using Jenkins CI server, we'd also have to create new jobs to build these dar POMs.

So yes it would work but it would not be very convenient.

Regards,

Jonathan

Jonathan Piron 0 votes
0
Avatar

Hi John

You'll hopefully be glad to hear that the 3.9.0 release of the plugin should now support an <applicationName> configuration parameter which defaults to the artifact ID but allows you to override the CI-Application manifest attribute.

Please let us know if that meets your requirements!

Regards

Andrew

XebiaLabs

XebiaLabs Support 0 votes