Building feature packs and pm/wildfly/tasks.xml

152 views
Skip to first unread message

Mike Douglass

unread,
Dec 11, 2021, 1:02:20 AM12/11/21
to WildFly
I'm trying to build a bedework feature pack to simplify installation of bedework on wildfly using the wildfly-galleon-maven-plugin.

I think I've discovered how to copy resources into arbitrary directories by looking at some examples. However I haven't (yet) found documentation for what can go into the pm/wildfly/tasks.xml or indeed what files can go into pm/wildfly/

The documentation for this plugin is a bit vague on these points. Are there any further docs I've missed?

Jean Francois Denise

unread,
Dec 13, 2021, 5:04:05 AM12/13/21
to wil...@googlegroups.com
Hi Mike,
you are right we have no proper documentation to cover the tasks.
I am currently adding some content to the plugin documentation to cover this missing topic. Will reply to this thread when ready.
For now you can look at all the classes that extend WildFlyPackageTask They can be used as element inside the tasks.xml.
We have examples in some of the WildFly feature-pack packages.
JF.
--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/21261ca5-d7f8-485a-b7ac-285d70cb46e1n%40googlegroups.com.


Michael Douglass

unread,
Dec 13, 2021, 12:26:56 PM12/13/21
to wil...@googlegroups.com


On 12/13/21 05:03, Jean Francois Denise wrote:
Hi Mike,
you are right we have no proper documentation to cover the tasks.
I am currently adding some content to the plugin documentation to cover this missing topic. Will reply to this thread when ready.
For now you can look at all the classes that extend WildFlyPackageTask They can be used as element inside the tasks.xml.
We have examples in some of the WildFly feature-pack packages.


Thank you - I've been looking through those. I've also found the keycloak extension a useful source

Are there schemas for the various files? For example I can't locate a schema for urn:jboss:galleon:layer-spec:1.0

Importing those into intellij would show what's valid.

JF.

On 12/11/21 7:02 AM, Mike Douglass wrote:
I'm trying to build a bedework feature pack to simplify installation of bedework on wildfly using the wildfly-galleon-maven-plugin.

I think I've discovered how to copy resources into arbitrary directories by looking at some examples. However I haven't (yet) found documentation for what can go into the pm/wildfly/tasks.xml or indeed what files can go into pm/wildfly/

The documentation for this plugin is a bit vague on these points. Are there any further docs I've missed?
--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/21261ca5-d7f8-485a-b7ac-285d70cb46e1n%40googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "WildFly" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wildfly/7JOsmPOK8C8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/5b46896c-193d-736b-6dee-8372ddb8b3c1%40redhat.com.

Jean Francois Denise

unread,
Dec 13, 2021, 12:45:39 PM12/13/21
to wil...@googlegroups.com
Mike,
I have been working on a schema for tasks.xml

We need a schema for Galleon layers, I will take the time to define it.

Thank-you for your reports!

JF

Michael Douglass

unread,
Dec 13, 2021, 4:37:56 PM12/13/21
to wil...@googlegroups.com


On 12/13/21 12:45, Jean Francois Denise wrote:
Mike,
I have been working on a schema for tasks.xml


That's great. I downloaded the xsd and now the valid choices show up in the intellij editor



We need a schema for Galleon layers, I will take the time to define it.

Thank-you for your reports!
and thank you for your help

Michael Douglass

unread,
Dec 13, 2021, 5:51:10 PM12/13/21
to wil...@googlegroups.com

I have another question:

To date I build he bedework quickstart on wildfly built with this:

galleon.sh install wildfly:25.0#25.0.1.FINAL --dir=wf --layers=datasources-web-server,jms-activemq,webservices

For what I'm doing I think I want the equivalent of

galleon.sh install wildfly:25.0#25.0.1.FINAL --dir=wf --layers=web-server,jms-activemq,webservices

I'll add datasources for some deployments and not others.

Currently my wildfly-feature-pack-build.xml looks like this:

<build xmlns="urn:wildfly:feature-pack-build:3.2" producer="org.bedework:bedework-galleon-pack">
    <dependencies>
        <dependency group-id="org.wildfly" artifact-id="wildfly-servlet-galleon-pack">
            <name>org.wildfly:wildfly-servlet-galleon-pack</name>

            <default-configs inherit="false">
                <include name="standalone.xml" model="standalone"/>
            </default-configs>
        </dependency>
    </dependencies>
    <generate-feature-specs>
    </generate-feature-specs>
</build>

That seems close but doesn't give me activemq. I hada  dependency on wildfly-galleon-pack but that seemed to pull in the entire world.

I suspect wildfly-galleon-pack is the correct dependency but I need to limit the installed packages - where do i specify the layers I want?

On 12/13/21 12:45, Jean Francois Denise wrote:

Jean Francois Denise

unread,
Dec 14, 2021, 7:04:21 AM12/14/21
to wil...@googlegroups.com
Hi Michael,
you can depend on wildfly-galleon-pack (even wildfly-ee-galleon-pack if you don't depend on microprofile-xxx subsystems) when building your feature-pack. What is downloaded during feature-pack build is not what will get provisioned when you install a server.
The content installed during provisioning is ruled by the specified layers (web-server,jms-activemq,webservices).
Hope that helps.
JF

Michael Douglass

unread,
Dec 14, 2021, 11:41:25 AM12/14/21
to Jean Francois Denise, wil...@googlegroups.com


On 12/14/21 07:04, Jean Francois Denise wrote:
Hi Michael,
you can depend on wildfly-galleon-pack (even wildfly-ee-galleon-pack if you don't depend on microprofile-xxx subsystems) when building your feature-pack. What is downloaded during feature-pack build is not what will get provisioned when you install a server.
The content installed during provisioning is ruled by the specified layers (web-server,jms-activemq,webservices).
Hope that helps.
Thanks for your help - let me know if this gets too annoying - I feel posting my experiences as i work on this might provide a different perspective.

What I'm trying to do is to simplify the bedework install for largely non-technical people so I'm hoping to be able to reduce it to something like

galleon.sh install org.bedework:bw-wf-feature-pack --dir=wildfly --layers=bw-calendar

and have a minimal install of wildfly with the requested bedework components installed.

What I initially expected I might find with the maven plugin is that I could specify the default layers I wanted much liek I would on the command line.

I changed my dependency to wildfly-ee-galleon-pack to at least make activemq available - what gets installed includes clustering, ejb3 and discovery which I want to exclude. However, none of those are defined as packages - just as layers.

From my naive point of view I expected to be able to have this 

<build xmlns="urn:wildfly:feature-pack-build:3.2" producer="org.bedework:bedework-galleon-pack">
    <dependencies
>
        <dependency group-id="org.wildfly" artifact-id="wildfly-galleon-pack">
            <name>org.wildfly:wildfly-galleon-pack</name>

            <layers inherit="false">
                <include name="web-server"/>
                ...
            </layers>

            <default-configs inherit="false">
                <include name="standalone.xml" model="standalone"/>
            </default-configs>
        </dependency>
    </dependencies>
    <generate-feature-specs>
    </generate-feature-specs>
</build>

but I guess there are reasons why not? Or just not implemented?

Alternatively can I exclude all packages and have my layer depend on the minimal layers I want?


Jean Francois Denise

unread,
Dec 14, 2021, 12:07:18 PM12/14/21
to Michael Douglass, wil...@googlegroups.com
For your use case it seems that you should define a default configuration in your feature-pack and not expose galleon layers.
You want to achieve:

galleon.sh install org.bedework:bw-wf-feature-pack:1.0.0 --dir=wildfly --optional-packages=passive+

and have just what you want. That is possible.

Your feature-pack-build file should look like:

<build xmlns="urn:wildfly:feature-pack-build:3.2" producer="org.bedework:bedework-galleon-pack">
    <dependencies>
        <dependency group-id="org.wildfly" artifact-id="wildfly-ee-galleon-pack">
            <name>org.wildfly:wildfly-ee-galleon-pack</name>
            <default-configs inherit="false"/>
            <packages inherit="false"/>
        </dependency>
    </dependencies>
    <config name="standalone.xml" model="standalone"/>
</build>

Then create the file src/main/resources/configs/standalone/standalone.xml/config.xml that contains your standalone.xml default config:

<?xml version="1.0" ?>
<config xmlns="urn:jboss:galleon:config:1.0" name="standalone.xml" model="standalone">
    <layers>
        <include name="web-server"/>
        <include name="jms-activemq"/>
        <include name="YOUR LAYER NAME, if any"/>
    </layers>
</config>

That should make it.
Let me know how you go.
Thank-you.
JF

Michael Douglass

unread,
Dec 14, 2021, 12:55:22 PM12/14/21
to Jean Francois Denise, wil...@googlegroups.com

Thank you very much - I'll give this a go later today

Michael Douglass

unread,
Dec 22, 2021, 3:13:32 PM12/22/21
to Jean Francois Denise, wil...@googlegroups.com

Hi - took a break to reorganise my build structure.

The chanegs below still seem to include clustering and discovery but it's fine for th etime being.

Perhaps you can give me a pointer to what's happening with copy-artifact?

I have this tasks.xml file:

<?xml version="1.0" ?>

<tasks xmlns="urn:wildfly:wildfly-feature-pack-tasks:3.0">
    <copy-artifact artifact="org.bedework.bw-tzsvr:bw-timezone-server-ear:ear"
                   to-location="standalone/deployments/" extract="true" />
    <copy-path src="resources/artifact.dodeploy" relative-to="resources"
               target="standalone/deployments/bw-timezone-server-${bedework.tz.version}.dodeploy"/>
</tasks>

which I hope will add a deployment

i'm seeing this message:

Error: Install failed.
 * Failed to execute an artifact copying task of feature-pack org.bedework:bedework-galleon-pack:1.0.0-SNAPSHOT package deploy.timezones
  * Failed to resolve org.bedework.bw-tzsvr:bw-timezone-server-ear:jar:ear
   * Could not find artifact org.bedework.bw-tzsvr:bw-timezone-server-ear:jar:ear in maven-central (https://repo1.maven.org/maven2/)
    * Could not find artifact org.bedework.bw-tzsvr:bw-timezone-server-ear:jar:ear in maven-central (https://repo1.maven.org/maven2/)

The artifact is in the snapshot repo at

https://oss.sonatype.org/content/repositories/snapshots/org/bedework/bw-tzsvr/bw-timezone-server-ear/5.0.0-SNAPSHOT/bw-timezone-server-ear-5.0.0-20211222.172754-1.ear

It seems like it's treating the type as a version


On 12/14/21 12:07, Jean Francois Denise wrote:

Jean Francois Denise

unread,
Dec 22, 2021, 4:17:11 PM12/22/21
to Michael Douglass, wil...@googlegroups.com
Hi,reply inlined.
On 12/22/21 9:13 PM, Michael Douglass wrote:

Hi - took a break to reorganise my build structure.

The chanegs below still seem to include clustering and discovery but it's fine for th etime being.

Perhaps you can give me a pointer to what's happening with copy-artifact?


I have this tasks.xml file:

<?xml version="1.0" ?>

<tasks xmlns="urn:wildfly:wildfly-feature-pack-tasks:3.0">
    <copy-artifact artifact="org.bedework.bw-tzsvr:bw-timezone-server-ear:ear"
                   to-location="standalone/deployments/" extract="true" />
    <copy-path src="resources/artifact.dodeploy" relative-to="resources"
               target="standalone/deployments/bw-timezone-server-${bedework.tz.version}.dodeploy"/>
</tasks>

which I hope will add a deployment

Should be org.bedework.bw-tzsvr:bw-timezone-server-ear:::ear

Michael Douglass

unread,
Dec 22, 2021, 9:02:06 PM12/22/21
to Jean Francois Denise, wil...@googlegroups.com


On 12/22/21 16:17, Jean Francois Denise wrote:
Hi,reply inlined.
On 12/22/21 9:13 PM, Michael Douglass wrote:

Hi - took a break to reorganise my build structure.

The chanegs below still seem to include clustering and discovery but it's fine for th etime being.

Perhaps you can give me a pointer to what's happening with copy-artifact?

https://github.com/wildfly/galleon-plugins/blob/master/galleon-plugins/src/main/java/org/wildfly/galleon/plugin/WfInstallPlugin.java#L937

I have this tasks.xml file:

<?xml version="1.0" ?>

<tasks xmlns="urn:wildfly:wildfly-feature-pack-tasks:3.0">
    <copy-artifact artifact="org.bedework.bw-tzsvr:bw-timezone-server-ear:ear"
                   to-location="standalone/deployments/" extract="true" />
    <copy-path src="resources/artifact.dodeploy" relative-to="resources"
               target="standalone/deployments/bw-timezone-server-${bedework.tz.version}.dodeploy"/>
</tasks>

which I hope will add a deployment

Should be org.bedework.bw-tzsvr:bw-timezone-server-ear:::ear

Perfect - thank you.

What are the 2 missing items?

By the way I copied this:

<copy-artifact artifact="org.wildfly.build:it-type-classifier-war:war" to-location="copied-artifacts/"/>

which is in

https://github.com/wildfly/wildfly-build-tools/blob/7d47e68c4c261c10ce58202c178bb717d692fbbe/provisioning-maven-plugin/src/it/it-type-classifier/feature-pack-dependent/feature-pack-build.xml

Michael Douglass

unread,
Dec 22, 2021, 9:27:17 PM12/22/21
to Jean Francois Denise, wil...@googlegroups.com

It look likes property substitution doesn't work for the actual files?

    <copy-path src="resources/artifact.dodeploy" relative-to="resources"
               target="standalone/deployments/bw-timezone-server-${bedework.tz.version}.dodeploy"/>

just creates a file standalone/deployments/bw-timezone-server-${bedework.tz.version}.dodeploy

I can work round this - just want to check I'm not missing something.

On 12/22/21 16:17, Jean Francois Denise wrote:

Mike Douglass

unread,
Dec 23, 2021, 3:53:11 PM12/23/21
to WildFly
I actually have a near working bedework (partial) install on wildfly.

Getting modules to install was a bit of a challenge. The documentation mentions a directory module-templates which doesn't seem to work. I was also adding modules directly under the modules/ directory and that doesn't appear to work. Once I moved them under system/layers/... they deployed as hoped. 

I'm assuming modules directly under the modules directory aren't supported by the wildfly galleon build because the method addModulePackages in

maven-plugin/src/main/java/org/wildfly/galleon/maven/WfFeaturePackBuildMojo.java

only seems to support layers and add-ons

If anyone wants a look my stuff is at https://github.com/Bedework/bw-wf-feature-pack

It's not yet at a state anyone can try it but getting closer.

Jean Francois Denise

unread,
Jan 5, 2022, 11:36:20 AM1/5/22
to Michael Douglass, wil...@googlegroups.com
Hi Michael,
FYI, the galleon-plugins documentation has been evolved with a complete example on how to create a feature-pack that defines custom galleon layers.
The example highlight the usage of the "build-user-feature-pack" goal. This goal offers a simpler usage and allows to put modules outside the layers and add-ons.

You are correct, the property substitution doesn't apply.

JF
Reply all
Reply to author
Forward
0 new messages