guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Couchman <vn...@apache.org>
Subject Re: Extension not working
Date Wed, 30 May 2018 18:07:45 GMT
On Wed, May 30, 2018 at 10:09 AM, elvelux <oscar@lantalde.net> wrote:

> Hello, i´m new to guacamole and i have managed to get it working with
> proxmox.
>
> But I have a problem. I am trying to add an extension to run a linux script
> when an user logs into guacamole.
>
> I have followed the guacamole manual in its 22th chapter and I have got the
> extension loaded into guacamole (log file says Extension "lantalde"
> loaded).
> The extension adds an event listener, but the code inside the listener is
> never run.
>
> I´m not sure if the problem is with the code or if i´m not creating the
> .jar
> correctly. The only way to get the extension loaded that I have find is
> creatin the .har with winrar including the guac-manifest.json and the
> pom.xml into it. I have tried to generate the .jar with a mvn package
> command, but then guacamole does not load the plugin because the manifest
> is
> not in the root of the .jar file.
>

I strongly advise that you do not try to create the JAR file manually.  You
should set up a Maven project, with a working pom.xml, and allow Maven to
assembly it for you.  It is possible to do on your own, but you'll have
much better success getting it to work if you allow the tool to do it.

Your Java class and pom.xml look okay, but it looks like maybe you're
missing the parts that actually do the packaging.  I suggest looking at the
other extensions already in the source code to see how they implement it.
For example, in pom.xml, you should see this:

            <!-- Assembly plugin - for easy distribution -->
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>

<finalName>${project.artifactId}-${project.version}</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/main/assembly/dist.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-dist-archive</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Then, you'll need to create the src/main/assembly/dist.xml file in the
extension and populate it.  Again, look at any existing extension and copy
what's in there and customize to suit your needs.

-Nick

Mime
View raw message