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

Hi,

I have upgraded my jenkins version from 2.227 to 2.440.1 version , I have done the respective changes in my plugin too and things are working fine locally , Today i tried to create a pull request over Jenkins Git repo there i am getting below error

I read the log also , there i found the issue related to “Getting Unknown packaging: hpi @ io.jenkins.plugins error” .
Below is my pom.xml

<?xml version="1.0" encoding="UTF-8"?> 4.0.0 org.jenkins-ci.plugins plugin 4.78 io.jenkins.plugins leapwork ${revision}${changelist} hpi 4.0.10 -SNAPSHOT jenkinsci/leapwork-plugin -SNAPSHOT 2.440.1 11 jenkinsci/leapwork-plugin 11 11 Leapwork https://github.com/${gitHubRepo}
<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>io.jenkins.plugins</groupId>
			<artifactId>jakarta-activation-api</artifactId>
			<version>2.1.3-1</version>
		</dependency>

	</dependencies>
</dependencyManagement>
<dependencies>
	<dependency>
		<groupId>com.github.spotbugs</groupId>
		<artifactId>spotbugs-annotations</artifactId>
		<version>4.8.3</version>
	</dependency>
	<dependency>
		<groupId>org.kohsuke</groupId>
		<artifactId>access-modifier-annotation</artifactId>
		<version>1.33</version>
	</dependency>
	<dependency>
		<!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
		<groupId>io.jenkins.tools.bom</groupId>
		<artifactId>bom-2.440.x</artifactId>
		<version>2815.vf5d6f093b_23e</version>
		<scope>test</scope>
		<type>pom</type>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins</groupId>
		<artifactId>structs</artifactId>
		<version>337.v1b_04ea_4df7c8</version>			
	</dependency>
	<dependency>
		<groupId>io.jenkins.plugins</groupId>
		<artifactId>caffeine-api</artifactId>
		<version>3.1.8-133.v17b_1ff2e0599</version>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins.workflow</groupId>
		<artifactId>workflow-cps</artifactId>
		<version>3883.vb_3ff2a_e3eea_f</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins.workflow</groupId>
		<artifactId>workflow-job</artifactId>
		<version>1400.v7fd111b_ec82f</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins.workflow</groupId>
		<artifactId>workflow-basic-steps</artifactId>
		<version>1049.v257a_e6b_30fb_d</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.ning</groupId>
		<artifactId>async-http-client</artifactId>
		<version>1.9.40</version>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-api</artifactId>
		<version>1.7.32</version>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-nop</artifactId>
		<version>1.7.32</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.google.code.gson</groupId>
		<artifactId>gson</artifactId>
		<version>2.8.0</version>
	</dependency>

	<dependency>
		<groupId>org.jenkins-ci.plugins</groupId>
		<artifactId>anything-goes-formatter</artifactId>
		<version>1.0</version>
	</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>com.google.code.findbugs</groupId>
		<artifactId>annotations</artifactId>
		<version>3.0.1u2</version>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins.workflow</groupId>
		<artifactId>workflow-durable-task-step</artifactId>
		<version>1331.vc8c2fed35334</version>
		<scope>test</scope>
	</dependency>
</dependencies>
<licenses>
	<license>
		<name>MIT License</name>
		<url>https://opensource.org/licenses/MIT</url>
	</license>
</licenses>
<!-- If you want this to appear on the plugin site page: -->
<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>mulesoft-releases</id>
		<name>MuleSoft Repository</name>
		<url>http://repository.mulesoft.org/releases/</url>
		<layout>default</layout>
	</repository>
	<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>

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.8.1</version>
			<!-- Update to the latest version -->
			<configuration>
				<source>11</source>
				<target>11</target>
			</configuration>
		</plugin>
	</plugins>
</build>

.

Can anyone assist me for the same ?

I’ll leave some comments on your PR

i saw your comments and performed all the suggestions given by you, but while raising pull request , test cases are failing and i am getting below errror.

below is my pom.xml

<?xml version="1.0" encoding="UTF-8"?> 4.0.0 org.jenkins-ci.plugins plugin 4.78 io.jenkins.plugins leapwork ${revision}${changelist} hpi 4.0.10 -SNAPSHOT jenkinsci/leapwork-plugin -SNAPSHOT 2.440.1 11 jenkinsci/leapwork-plugin 11 11 Leapwork https://github.com/${gitHubRepo}
<dependencyManagement>
	<dependencies>
		<dependency>
			<!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
			<groupId>io.jenkins.tools.bom</groupId>
			<artifactId>bom-2.440.x</artifactId>
			<version>2815.vf5d6f093b_23e</version>
			<scope>import</scope>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>io.jenkins.plugins</groupId>
			<artifactId>jakarta-activation-api</artifactId>
			<version>2.0.1-3</version>
		</dependency>

	</dependencies>
</dependencyManagement>
<dependencies>
	<dependency>
		<groupId>com.github.spotbugs</groupId>
		<artifactId>spotbugs-annotations</artifactId>
		<version>4.8.3</version>
	</dependency>
	<dependency>
		<groupId>org.kohsuke</groupId>
		<artifactId>access-modifier-annotation</artifactId>
		<version>1.33</version>
	</dependency>
	<dependency>
		<!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
		<groupId>io.jenkins.tools.bom</groupId>
		<artifactId>bom-2.440.x</artifactId>
		<version>2815.vf5d6f093b_23e</version>
		<scope>import</scope>
		<type>pom</type>
	</dependency>
	<dependency>
		<groupId>io.jenkins.plugins</groupId>
		<artifactId>jakarta-activation-api</artifactId>
		<version>2.0.1-3</version>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins</groupId>
		<artifactId>structs</artifactId>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins.workflow</groupId>
		<artifactId>workflow-cps</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins.workflow</groupId>
		<artifactId>workflow-job</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.jenkins-ci.plugins.workflow</groupId>
		<artifactId>workflow-basic-steps</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.ning</groupId>
		<artifactId>async-http-client</artifactId>
		<version>1.9.40</version>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-api</artifactId>
		<version>1.7.32</version>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-nop</artifactId>
		<version>1.7.32</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.google.code.gson</groupId>
		<artifactId>gson</artifactId>
		<version>2.8.0</version>
	</dependency>

	<dependency>
		<groupId>org.jenkins-ci.plugins</groupId>
		<artifactId>anything-goes-formatter</artifactId>
		<version>1.0</version>
	</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>com.google.code.findbugs</groupId>
		<artifactId>annotations</artifactId>
		<version>3.0.1u2</version>
	</dependency>


	<dependency>
		<groupId>org.jenkins-ci.plugins.workflow</groupId>
		<artifactId>workflow-durable-task-step</artifactId>
		<scope>test</scope>
	</dependency>
</dependencies>

<licenses>
	<license>
		<name>MIT License</name>
		<url>https://opensource.org/licenses/MIT</url>
	</license>
</licenses>
<!-- If you want this to appear on the plugin site page: -->
<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>mulesoft-releases</id>
		<name>MuleSoft Repository</name>
		<url>http://repository.mulesoft.org/releases/</url>
		<layout>default</layout>
	</repository>
	<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>

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.8.1</version>
			<!-- Update to the latest version -->
			<configuration>
				<source>11</source>
				<target>11</target>
			</configuration>
		</plugin>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>3.17</version>
<extensions>true</extensions>
<executions>
    <execution>
        <id>default-hpi</id>
        <phase>package</phase>
        <goals>
            <goal>hpi</goal>
        </goals>
        <configuration>
            <showDeprecation>true</showDeprecation>
            <webApp>
                <contextPath>/jenkins</contextPath>
            </webApp>
            <minimumJavaVersion>11</minimumJavaVersion>
            <systemProperties>
                <hudson.Main.development>true</hudson.Main.development>
            </systemProperties>
        </configuration>
    </execution>
    <execution>
        <id>default-insert-test</id>
        <phase>generate-test-sources</phase>
        <goals>
            <goal>insert-test</goal>
        </goals>
        <configuration>
            <showDeprecation>true</showDeprecation>
            <webApp>
                <contextPath>/jenkins</contextPath>
            </webApp>
            <minimumJavaVersion>11</minimumJavaVersion>
            <systemProperties>
                <hudson.Main.development>true</hudson.Main.development>
            </systemProperties>
        </configuration>
    </execution>
    <execution>
        <id>default-test-hpl</id>
        <phase>test-compile</phase>
        <goals>
            <goal>test-hpl</goal>
        </goals>
        <configuration>
            <showDeprecation>true</showDeprecation>
            <webApp>
                <contextPath>/jenkins</contextPath>
            </webApp>
            <minimumJavaVersion>11</minimumJavaVersion>
            <systemProperties>
                <hudson.Main.development>true</hudson.Main.development>
            </systemProperties>
        </configuration>
    </execution>
    <execution>
        <id>default-resolve-test-dependencies</id>
        <phase>test-compile</phase>
        <goals>
            <goal>resolve-test-dependencies</goal>
        </goals>
        <configuration>
            <showDeprecation>true</showDeprecation>
            <webApp>
                <contextPath>/jenkins</contextPath>
            </webApp>
            <minimumJavaVersion>11</minimumJavaVersion>
            <systemProperties>
                <hudson.Main.development>true</hudson.Main.development>
            </systemProperties>
        </configuration>
    </execution>
    <execution>
        <id>default-validate</id>
        <phase>validate</phase>
        <goals>
            <goal>validate</goal>
        </goals>
        <configuration>
            <showDeprecation>true</showDeprecation>
            <webApp>
                <contextPath>/jenkins</contextPath>
            </webApp>
            <minimumJavaVersion>11</minimumJavaVersion>
            <systemProperties>
                <hudson.Main.development>true</hudson.Main.development>
            </systemProperties>
        </configuration>
    </execution>
    <execution>
        <id>default-cli</id>
        <goals>
            <goal>run</goal>
        </goals>
        <configuration>
            <minimumJavaVersion>11</minimumJavaVersion>
            <showDeprecation>true</showDeprecation>
            <webApp>
                <contextPath>/jenkins</contextPath>
            </webApp>
            <systemProperties>
                <hudson.Main.development>true</hudson.Main.development>
            </systemProperties>
        </configuration>
    </execution>
</executions>
org.apache.maven.plugins maven-enforcer-plugin 3.4.1 enforce-java display-info 11 3.9.6

I posted a complete pom.xml in your PR that cleans up all unnecessary stuff. Just try this one out. It works locally and I expect it to work also on ci.jenkins.io

let me try right now and let you know in sometime.Thank you !

I used the exact pom.xml shared by you, it is building successfully locally but while I pushed the code in git, I am getting below error now.

I am totally stuck in this issue and to fix this hpi error, I added the plugin block of maven-hpi-plugin. in that case I am getting another error in Jenkin pipeline.

My major concern is that if it’s working locally then why it is not working in Jenkins pipeline. If Jenkins pipeline is expecting another version of java, maven etc. then that should log into the build log, that info also i did not find it anywhere.

Please Guide me . Thank you !!

One more clarification from my side, I am too able to do the respective work in ci.jenkins.io and it is working fine there. But here i am talking about its failure while pushing the code from my branch to Jenkinssci:main

Below is the url of PR where we can see in check section , it is failing enhancement : Jenkins Plugin Upgrade by Munishkumar92 · Pull Request #30 · jenkinsci/leapwork-plugin (github.com)

As I wrote in the PR your problem is that the build is running with Java8 on ci.jenkins.io. You will first need to adjust the Jenkinsfile in a separate PR and merge it so it runs with Java 11 and then your PR will work fine.

1 Like

As you mentioned only parameter to mention is linux but while build run, i can see in the diagram, it runs on windows and linux both so shall i add a code block like below buildPlugin(useContainerAgent: true,
configurations: [
[platform: ‘linux’, jdk: 11],
[platform: ‘windows’, jdk: 11],
])

As you have no own tests I don’t see the need to do a windows build. Just a waste of resources.

Hi,

I raised the PR one for configuration and other for pom part , now all test cases were passing but while building for windows , i am getting below error

Here is my pom.xml

<?xml version="1.0" encoding="UTF-8"?> 4.0.0 org.jenkins-ci.plugins plugin 4.80 io.jenkins.plugins leapwork ${revision}${changelist} hpi 4.0.11 -SNAPSHOT jenkinsci/leapwork-plugin 2.440.1 jenkinsci/leapwork-plugin Leapwork https://github.com/${gitHubRepo}
<dependencyManagement>
	<dependencies>
		<dependency>
			<!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
			<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>
</dependencies>

<licenses>
	<license>
		<name>MIT License</name>
		<url>https://opensource.org/licenses/MIT</url>
	</license>
</licenses>
<!-- If you want this to appear on the plugin site page: -->
<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>

@mawinter69 am i missing any dependency in pom.xml due to that i am facing this issue ?

Kindly suggest

that looks like a temporary problem on Jenkins side.

org.apache.maven.cli.internal.ExtensionResolutionException: Extension io.jenkins.tools.incrementals:git-changelist-maven-extension:1.2 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.eclipse.jgit:org.eclipse.jgit:jar:4.9.0.201710071750-r (absent): Could not transfer artifact org.eclipse.jgit:org.eclipse.jgit:jar:4.9.0.201710071750-r from/to azure-proxy (https://repo.azure.jenkins.io/): status code: 502, reason phrase: Bad Gateway (502)
1 Like

Will it allow me to merge this PR if these checks are not going to get successful?

you should be able to rerun the checks.

1 Like

Thank you so much for your assistance!!! I have successfully merged my PR. Once again Thank you!