tisonkun / os-detector

Detect OS/Platform information for Java program.
Apache License 2.0
3 stars 1 forks source link

fix: compatible with Maven 4 #9

Closed gnodet closed 6 days ago

gnodet commented 6 days ago
tisonkun commented 6 days ago

@gnodet Thank you! I'm going to integrate with you changes, merge and release.

But still, I wonder how the removed part are "supporting Maven 4", so that I may pick up this topic later to deliver a good integration :D

gnodet commented 6 days ago

@gnodet Thank you! I'm going to integrate with you changes, merge and release.

But still, I wonder how the removed part are "supporting Maven 4", so that I may pick up this topic later to deliver a good integration :D

The PropertyContributor is new to the Maven 4 API, so it can only be loaded if running in Maven 4, in which case, to avoid running the code twice, it disables the Maven 3 extension. The idea was that the internals may change in Maven 4 in the future and the Maven 3 extension may not work anymore with Maven 4 in the future.
However, things have changed a lot since I worked on that, and the Maven 4 extension should be rewritten anyway.

tisonkun commented 6 days ago

the Maven 4 extension should be rewritten anyway.

Yes. As long as Maven 4 is released or the API is relatively stable, and there are enough docs to start with, I'd write a plugin-maven-4 for it.

tisonkun commented 6 days ago

OK. Then Let me merge and release this patch today. Thanks again for your information.

tisonkun commented 6 days ago

I found that this is actually a fix. So I publish 0.3.1 for it.

@linghengqian you can try to replace the os-maven-plugin with:

    <build>
        <extensions>
            <extension>
                <groupId>com.tisonkun.os</groupId>
                <artifactId>os-detector-maven-plugin</artifactId>
                <version>0.3.1</version>
            </extension>
        </extensions>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.opendal</groupId>
            <artifactId>opendal</artifactId>
            <version>${opendal.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.opendal</groupId>
            <artifactId>opendal</artifactId>
            <version>${opendal.version}</version>
            <classifier>${os.detected.classifier}</classifier>
        </dependency>
    </dependencies>

The same user experience.

tisonkun commented 6 days ago

Before release a 1.0, I'd try to find some time consider #6 and #7. And always try to seek the opportunity to work with both Trustin and Google (the upstream) so that we merge the community instead of fork another ..

linghengqian commented 6 days ago

@linghengqian you can try to replace the os-maven-plugin with: