Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mave moudle has wrong compile order, sharding-sql-test should be compiled before sharding-core #2045

Closed
tankilo opened this issue Mar 17, 2019 · 2 comments

Comments

@tankilo
Copy link

tankilo commented Mar 17, 2019

Bug Report

Mave moudle has wrong compile order.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details.
If no response more than 7 days and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

4.0.0-RC1-SNAPSHOT

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Expected behavior

    <modules>
        <module>sharding-sql-test</module>

        <module>sharding-core</module>
        
        <module>sharding-jdbc</module>
        <module>sharding-proxy</module>
        
        <module>sharding-transaction</module>
        <module>sharding-orchestration</module>
        <module>sharding-opentracing</module>
    
        <module>sharding-spring</module>
    </modules>

Actual behavior

sub modules of sharding-core rely on module sharding-sql-test, compile will fail if you are doing this for the first time.
image

    <modules>
        <module>sharding-core</module>
        
        <module>sharding-jdbc</module>
        <module>sharding-proxy</module>
        
        <module>sharding-transaction</module>
        <module>sharding-orchestration</module>
        <module>sharding-opentracing</module>
    
        <module>sharding-spring</module>
        <module>sharding-sql-test</module>
    </modules>

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

@tankilo tankilo closed this as completed Mar 17, 2019
@terrymanu
Copy link
Member

Can you explain the reason for close this issue?

@tankilo
Copy link
Author

tankilo commented Mar 17, 2019

Can you explain the reason for close this issue?

In fact, yesterday night, i did ran into error when i try to compile the code. But this morning, after i posted this issue , i couldn't reproduce this problem again (clean related jars in local maven repo and compile).
Though sharding-sql-test is the last one in the <modules> element of the parent pom.xml, it's still compiled before some modules of sharding-core.

[INFO] Reactor Build Order:
[INFO] 
[INFO] sharding-sphere
[INFO] sharding-core
[INFO] sharding-core-api
[INFO] sharding-core-common
[INFO] sharding-core-parse
[INFO] sharding-core-parse-spi
[INFO] sharding-sql-test
[INFO] sharding-core-parse-common
[INFO] sharding-core-parse-mysql
[INFO] sharding-core-parse-postgresql
[INFO] sharding-core-parse-oracle
[INFO] sharding-core-parse-sqlserver

Before, i think module building order is just the same as what we define in <modules> element of the parent pom.xml.
Now, after Googling, maven is smarter than I thought.
https://stackoverflow.com/questions/18629897/maven-build-order-multiple-modules
http://maven.apache.org/guides/mini/guide-multiple-modules.html

Reactor Sorting
Because modules within a multi-module build can depend on each other, it is important that the reactor sorts all the projects in a way that guarantees any project is built before it is required.

The following relationships are honoured when sorting projects:

a project dependency on another module in the build
a plugin declaration where the plugin is another module in the build
a plugin dependency on another module in the build
a build extension declaration on another module in the build
the order declared in the element (if no other rule applies)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants