hilla icon indicating copy to clipboard operation
hilla copied to clipboard

support maven system dependency

Open sheiy opened this issue 11 months ago • 8 comments

Describe your motivation

support maven system scope dependency

  <dependency>
            <groupId>taobao</groupId>
            <artifactId>sdk-java</artifactId>
            <version>auto_1709828590347-20240314</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/taobao-sdk-java-auto_1709828590347-20240314.jar</systemPath>
        </dependency>
<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

sheiy avatar Mar 18 '24 13:03 sheiy

Not sure what exactly you are looking for here but it seems like system dependencies are discouraged by Maven: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#system-dependencies

Artur- avatar Mar 18 '24 14:03 Artur-

What would this feature help you achieve? Could there be another way of achieving that without relying on deprecated features?

Legioth avatar Mar 18 '24 14:03 Legioth

Because in some cases, the jar files used are provided by third-party companies and not published in any Maven repository; So at this point, it needs to be used as a system scope and packaged into a jar package during exec maven package; Spring boot maven plugin supports configuration <includeSystemScope>true</includeSystemScope> which can effectively solve my problem; But Hilla will report an error. For now. I install the jar file with mvn install:install-file to solve this problem. But it is not a good experience

sheiy avatar Mar 18 '24 14:03 sheiy

The correct place to address this would probably be in https://github.com/vaadin/flow/blob/e973f16fe406fde24b0a6d987c5b9a9d9a2d5784/flow-plugins/flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/FlowModeAbstractMojo.java#L245-L248

Legioth avatar Mar 26 '24 15:03 Legioth

For reference, this is the discussion that lead to including this feature in Spring Boot. https://github.com/spring-projects/spring-boot/issues/2224

To me, the key point is really this comment:

Usecase where I see this is with some wrapper libraries not available in maven - and CI server being operated centrally and not liking people adding stuff to repositories on their own, or running own repositories.

Legioth avatar Apr 02 '24 12:04 Legioth

...and here's a discussion related to why the Maven maintainers think that the system scope should be deprecated: https://issues.apache.org/jira/browse/MNG-6523

My interpretation is that Maven has this feature for other purposes and the Maven maintainers think the way it's actually used is wrong and shouldn't be needed in a perfect world. They think you should make the world perfect rather than relying on Maven to officially support the current state of the world.

Legioth avatar Apr 02 '24 14:04 Legioth

Let's follow what Spring Boot does here: add a property flag that enables this.

platosha avatar Apr 09 '24 11:04 platosha

As part of the solution, let us verify that Hilla supports entities from system dependencies.

platosha avatar Apr 09 '24 11:04 platosha