terminological / r6-generator

Multi-module maven project for a code generation framework allowing Java libraries to be used in R.
MIT License
0 stars 0 forks source link

Maven release packaging issue #11

Closed jdimeo closed 6 days ago

jdimeo commented 1 week ago

Starting to dig in to this sweet plugin!

When I download from Maven central, the parent seems to have been overwritten with a generated/fake POM during the release process. It's not the real one I see here on GitHub, but one with jar packaging. I've attached the one that Maven pulled.

r6-generator-1.1.0-orig.pom.txt

robchallen commented 6 days ago

Sorry for delay replying.

That is the project parent pom. It will get imported along with the individual modules.

You shouldn't need to reference the project directly it was just organised that way for my convenience. It's the modules you need.

The artifacts you want are:

r6-generator-runtime as a runtime dependency r6-generator-maven-plugin as a build dependency

LMK if that is not enough to go on. Maybe you could post your pom.xml if not.

robchallen commented 6 days ago

And yes the parent pom does get rewritten during release to strip out the references to the release mechanics. Is it causing a problem?

jdimeo commented 6 days ago

The artifacts you want are: r6-generator-runtime as a runtime dependency r6-generator-maven-plugin as a build dependency

Understood, yes, but even when just simply declaring them as normal dependencies, Maven downloads their referenced parent, hits the re-written POM, and fails on it being jar packaging instead of pom packaging. I'm not referencing it directly.

robchallen commented 6 days ago

Ok I understand now. I'll take a look.

robchallen commented 6 days ago

I can't replicate this issue. On a fresh user with no maven history I can use the archteype to generate a skeleton project pom and locally install that. The parent pom seems to get downloaded OK:

test@machine:~/.m2/repository/io/github/terminological/r6-generator/1.1.0$ cat r6-generator-1.1.0.pom
<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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>

        <!--<groupId>io.github.terminological</groupId>-->
        <artifactId>r6-generator</artifactId>
        <packaging>pom</packaging>
        <version>1.1.0</version>
        <name>R6 generator</name>
        <description>
R can use `rJava` to communicate with java. R also has a class system called
R6. If you want to use a java library with native `rJava` in R there is 
potentially a lot of glue code needed, and R library specific packaging 
configuration required. However if you don't mind writing an R-centric API
...

There isn't anything in this part of the mechanics that should modify the pom. Only during the build of an R project, with a sources only project does it flatten the POM, but it doesn't sound like you got that far.

Is it worth deleting your ~/.m2/repository/io/github/terminological directory and trying again?

Could it be some maven configuration issue, on your side?

Mysterious. Happy to jump on a call to try and debug it (maybe on Monday).

jdimeo commented 6 days ago

Yeah, thank you so much for looking at this for me. On my work computer, I did already try to remove the past downloads of io.github.terminological before (that was the first thing I thought of) and I still hit a snag and had to edit my local cache's copy of the parent POM.

However, I also tried on my personal computer just now and it also seemed to work. Maybe I did a specific weird order on my work computer, like accidentally referencing the parent POM as a <dependency> before correcting it to the runtime or maven-plugin, thus confusing Maven to pull the parent as a dependency, and some other CDN caching from Maven made me download the wrong one again.

I think we can close this! I hit another error on my "hello world" return-a-version method from within R, but I'm still working through that and am using your great examples, so I won't open another ticket yet until I'm stuck. I love the vision of this!

robchallen commented 6 days ago

Good to hear!

On Fri, 8 Nov 2024, 17:49 John Dimeo, @.***> wrote:

Yeah, thank you so much for looking at this for me. On my work computer, I did already try to remove the past downloads of io.github.terminological before (that was the first thing I thought of) and I still hit a snag and had to edit my local cache's copy of the parent POM.

However, I also tried on my personal computer just now and it also seemed to work. Maybe I did a specific weird order on my work computer, like accidentally referencing the parent POM as a before correcting it to the runtime or maven-plugin, thus confusing Maven to pull the parent as a dependency, and some other CDN caching from Maven made me download the wrong one again.

I think we can close this! I hit another error on my "hello world" return-a-version method from within R, but I'm still working through that and am using your great examples, so I won't open another ticket yet until I'm stuck. I love the vision of this!

— Reply to this email directly, view it on GitHub https://github.com/terminological/r6-generator/issues/11#issuecomment-2465424970, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6SWIBLLK37YT46VFENXYTZ7T2TPAVCNFSM6AAAAABRCKHLYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRVGQZDIOJXGA . You are receiving this because you commented.Message ID: @.***>