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

Eclipse cannot resolve correct project version which depended at same workspace #90

Open
YannLex opened this issue Mar 8, 2019 · 1 comment

Comments

@YannLex
Copy link

YannLex commented Mar 8, 2019

I have two multi-modules projects at same workspace in eclipse.
Project A had revision 0.0.1, and defined a submodule in dependencyManagement like this,

<dependencyManagement>
	<dependencies>
               <dependency>
		  <groupId>com.foo.a</groupId>
	          <artifactId>a-common</artifactId>
	      </dependency>
	</dependencies>
</dependencyManagement>

Project B had revision 0.0.2, project B use project A as it's parent,

<parent>
	<groupId>com.foo.a</groupId>
	<artifactId>a-parent</artifactId>
	<version>0.0.1</version>
</parent>
<dependencies>
	<dependency>
		<groupId>com.foo.a</groupId>
		<artifactId>a-common</artifactId>
	</dependency>
</dependencies>

but resolve dependency a-common as version 0.0.2, a-common-0.0.2 not exist.
If I close Project A in eclipse, all things goes right.
How can maven in eclipse resolve the correct a-common version without close project A?

@YannLex
Copy link
Author

YannLex commented Mar 8, 2019

My maven pom.xml eclipse lifecycle configuration:

<plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
        <lifecycleMappingMetadata>
            <pluginExecutions>
                <pluginExecution>
                    <pluginExecutionFilter>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>flatten-maven-plugin</artifactId>
                        <versionRange>[1.1.0,)</versionRange>
                        <configuration>
                            <pomElements>
                                <parent>remove</parent>
                            </pomElements>
                            <flattenMode>bom</flattenMode>
                        </configuration>
                        <goals>
                            <goal>flatten</goal>
                        </goals>
                    </pluginExecutionFilter>
                    <action>
                        <ignore></ignore>
                    </action>
                </pluginExecution>
            </pluginExecutions>
        </lifecycleMappingMetadata>
    </configuration>
</plugin>

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

No branches or pull requests

1 participant