mojohaus / rpm-maven-plugin

http://www.mojohaus.org/rpm-maven-plugin/
Other
56 stars 48 forks source link

Can't create RPM when dependencies are packaged as `bundle` #97

Closed josetesan closed 6 years ago

josetesan commented 6 years ago

When trying to pack a RPM file with some dependencies, when all of them where packaged as 'bundle' ( OSGI packages ), the plugin is unable to retrieve them properly.

my Artifact pom.xml


    <artifactId>myArtifact</artifactId>

    <packaging>bundle</packaging>

Application pom.xml


       <dependency>

                        <groupId>com.company.groupid</groupId>

                        <artifactId>myArtifact</artifactId>

                        <version>1.0</version>

                        <scope>runtime</scope>

                </dependency>

.

.

<build>

        <plugins>

            <plugin>

                <groupId>org.codehaus.mojo</groupId>

                <artifactId>rpm-maven-plugin</artifactId>

                <version>2.2.0</version>

                <extensions>true</extensions>

                <executions>

                    <execution>

                        <inherited>false</inherited>

                        <goals>

                            <goal>attached-rpm</goal>

                        </goals>

                        <phase>package</phase>

                    </execution>

                </executions>

                <configuration>

                    <vendor>${project.organization.name}</vendor>

                    <group>/usr/share/doc/rpm_${project.artifactId}-$version/GROUPS</group>

                    <name>${project.artifactId}</name>

                    <projversion>${project.version}</projversion>

                    <defaultFilemode>${rpm.file.attr.permission}</defaultFilemode>

                    <defaultUsername>${rpm.file.attr.name.user}</defaultUsername>

                    <defaultGroupname>${rpm.file.attr.name.group}</defaultGroupname>

                    <mappings>

                        <mapping>

                            <directory>${rpm.folder.dest.mediator}</directory>

                             <dependency/> <!-- all of them

                        </mapping>

.

.

.

And, in our repository, the artifacts are created :


[jenkins@JENKINS]$ ls -l  /home/jenkins/.m2/repository/com/company/groupId/myArtifact/1.0/

total 32

-rw-r----- 1 jenkins jenkins   280 Apr 19 17:24 _remote.repositories

-rw-r----- 1 jenkins jenkins   267 Apr 19 17:20 myArtifact-1.0.bundle.lastUpdated

-rw-r----- 1 jenkins jenkins 14190 Apr 19 17:24 myArtifact-1.0.jar

-rw-r----- 1 jenkins jenkins    40 Apr 19 16:06 myArtifact-1.0.jar.sha1

-rw-r----- 1 jenkins jenkins   868 Apr 19 17:23 myArtifact-1.0.pom

The error displayed is :


[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal on project EsbApps: Could not resolve dependencies for project com.company.groupId:artifact:rpm:1.3.0: Failure to find com.company.groupId.:myArtifact:bundle:1.0 in http://madprdjupdate:8080/artifactory/external was cached in the local repository, resolution will not be reattempted until the update interval of artifactory has elapsed or updates are forced

As as side note, we are using java 1.7 and maven 3.2.5 on a RHEL 6.7, and version 2.2.0 of the maven-rpm-plugin.

Thanks.

dantran commented 6 years ago

you may have staled local repo. also does it work with 2.1.5?

josetesan commented 6 years ago

Neither 2.1.5 nor others. I did remove The local repo also

Josetesan para iOS


From: Dan Tran notifications@github.com Sent: Thursday, April 19, 2018 8:23:37 PM To: mojohaus/rpm-maven-plugin Cc: Jose Luis; Author Subject: Re: [mojohaus/rpm-maven-plugin] Can't create RPM when dependencies are packaged as bundle (#97)

you may have staled local repo. also does it work with 2.1.5?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mojohaus/rpm-maven-plugin/issues/97#issuecomment-382834284, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAXZqakfP3Nh2-Oyw3D9ol3511fjBeJNks5tqNYpgaJpZM4TcJnG.

dantran commented 6 years ago

provide a simple pom file for me to test out. I can take a look

josetesan commented 6 years ago

Sorry, i think you can close this issue, as looks like it's not related to the rpm plugin, as i could reproduce it with the default maven dependencies plugin. Looks like it might be an issue with our artifactory/publish process.