I am new to maven and somewhat new to java. I tried Google and related sources, but I did not find what reminded me of my situation.
Now I have a maven project Xand Y. Xcan be considered as a common library with some utilities Y- it is simple JFramewith the printed "hello world"and invocation of the static method in X.
I execute the " maven install" in the project X, I get "build successful". I add the project Xas a dependency in the project Y(using the pom editor in Eclipse, browsing the repository and posting it). I execute the " maven package" in the project Y, I get "build successful". When starting a project, Yeither through java -jaror checking the bank, the project is Xabsent everywhere, and I get an unusual class exception. Eclipse finds it, and there are no compilation errors in the original editor.
Why does it only work in the Eclipse editor and not as a jar?
POM:
<dependency>
<groupId>com.company.deployment.shared</groupId>
<artifactId>com.company.deployment.shared</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
source
share