Getting Unknown packaging: hpi @ io.jenkins.plugins error

You mean , i need to remove the below dependency from my pom.xml

            <groupId>com.ning</groupId>
            <artifactId>async-http-client</artifactId>
            <version>1.9.40</version>
        </dependency>```
and on top of that in Jenkins , I tried to use JAXB plugin , it is also showing as grey out one. if i hover my mouse on it then it is showing the depency on other plugins and the chain is going on

![image|690x119](upload://B7HWE4iNsMCLOIn1IXgCSqIMZd.png)

@mawinter69

I don’t know your code so I can’t tell if you use the async-http-client or not. But in case you use it I would recommend to replace it with a modern http library.

Other plugins are also using jaxb plugin probably. You just need to replace the 2 direct dependencies for the jaxb libraries with a dependency to the jaxb plugin

I tried to add the dependencies related to jaxb but getting build error and all . Can we connect over google meet for 10-15 mins because i am stuck in this issue for last 10 days. It would be really appreciable if you can guide me for the same over call

seems the jaxb plugin refers to an older version of jaxb, might be that this is not compatible with your code.

No I’m not available for a call

ok, Let me try to do changes arounf jaxb

Hi @mawinter69 ,

I tried to add the dependency in pom.xml and jquery reference in global.jelly file as per documentation JQuery3 API | Jenkins plugin but still the jquery3 plugin is coming as greyed out.

Below is the code repository link jenkinsci/leapwork-plugin: Leapwork Integration with Jenkins (github.com)
and here is my updated pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>plugin</artifactId>
        <version>4.80</version>
        <relativePath/>
    </parent>
    <groupId>io.jenkins.plugins</groupId>
    <artifactId>leapwork</artifactId>
    <version>${revision}${changelist}</version>
    <packaging>hpi</packaging>
    <properties>
        <revision>4.0.11</revision>
        <changelist>-SNAPSHOT</changelist>
        <gitHubRepo>jenkinsci/leapwork-plugin</gitHubRepo>
        <jenkins.version>2.440.1</jenkins.version>
        <gitHubRepo>jenkinsci/leapwork-plugin</gitHubRepo>
    </properties>
    <name>Leapwork</name>
    <url>https://github.com/${gitHubRepo}</url>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.jenkins.tools.bom</groupId>
                <artifactId>bom-2.440.x</artifactId>
                <version>2815.vf5d6f093b_23e</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.ning</groupId>
            <artifactId>async-http-client</artifactId>
            <version>1.9.40</version>
        </dependency>
        <dependency>
            <groupId>io.jenkins.plugins</groupId>
            <artifactId>gson-api</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>3.0.0</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-nop</artifactId>
            <version>1.7.32</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.jenkins.plugins</groupId>
            <artifactId>jquery3-api</artifactId>
            <version>3.7.1-2</version>
        </dependency>
        <dependency>
            <groupId>io.jenkins.plugins</groupId>
            <artifactId>commons-lang3-api</artifactId>
            <version>3.13.0-62.v7d18e55f51e2</version>
        </dependency>
        <dependency>
            <groupId>io.jenkins.plugins</groupId>
            <artifactId>commons-text-api</artifactId>
            <version>1.11.0-95.v22a_d30ee5d36</version>
        </dependency>
    </dependencies>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Leapwork DevOps</name>
            <email>prioritysupport@leapwork.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/${gitHubRepo}</connection>
        <developerConnection>scm:git:git@github.com:${gitHubRepo}.git</developerConnection>
        <url>https://github.com/${gitHubRepo}</url>
        <tag>leapwork-4.0.5</tag>
    </scm>

    <repositories>
        <repository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
    </pluginRepositories>
</project>

Kindly assist me because i am stuck in this issue

As already stated, the jquery3 plugin is installed. In order to use it in your plugin you will need to add the following line in the jelly where you want to use jquery3
<st:adjunct includes="io.jenkins.plugins.jquery3"/>
It is not available by default.

I have 3 jelly files in the code global , config and index. So as per my understanding i added this line in global.jelly like below

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
    <!-- Include jQuery 3 -->
    <st:adjunct includes="io.jenkins.plugins.jquery3"/>

    <!--
        This Jelly script is used to produce the global configuration option.

        Jenkins uses a set of tag libraries to provide uniformity in forms.
        To determine where this tag is defined, first check the namespace URI,
        and then look under $JENKINS/views/. For example, <f:section> is defined
        in $JENKINS/views/lib/form/section.jelly.

        It's also often useful to just check other similar scripts to see what
        tags they use. Views are always organized according to its owner class,
        so it should be straightforward to find them.
    -->
    <!--
      <f:section title="Hello World Builder">
        <f:entry title="French" field="useFrench"
          description="Check if we should say hello in French">
          <f:checkbox />
        </f:entry>
      </f:section>
    -->
</j:jelly>

I am able to create .hpi file while running mvn clean package command . As I got to know plugin is already installed so how can i sure that my plugin is now compatible with Jquery3 from testing perspective ?

the global.jelly is the wrong place, you don’t have any code in there. You have your javascript code in

and load it in leapwork-plugin/src/main/resources/com/Leapwork/Leapwork_plugin/LeapworkJenkinsBridgeBuilder/config.jelly at 33a66231fbb6986425f9f99eca559c725e5646bb · jenkinsci/leapwork-plugin · GitHub
so you will need to add this line in the config.jelly.
You will also need to adjust your js code to make use of jqeury3 instead of jquery

See JQuery3 API the warning at the end.
Since Jenkins uses jQuery 1.x as well make sure to use the global symbol jQuery3rather than$ when accessing jQuery 3.x.

1 Like

let me try this and check

its working fine. Thank you so much for the help !