argouml-tigris-org / argouml

Main project of argouml. Some information in the wiki. Some old releases in releases. (depends on parentpom, testmodels)
246 stars 92 forks source link

Setting up on new machine, empty repository #49

Closed simonjwright closed 2 years ago

simonjwright commented 2 years ago

Setup:

$ mvn -v
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /Volumes/Miscellaneous1/apache-maven-3.8.5
Java version: 17.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "12.3.1", arch: "aarch64", family: "Mac"

Building (mvn package -DskipTests=true) resulted in

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.argouml:argouml-core:0.35.2-SNAPSHOT: Could not find artifact org.argouml:parentpom:pom:0.35.5-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 7, column 11
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.argouml:argouml-core:0.35.2-SNAPSHOT (/Volumes/Miscellaneous1/argouml/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.argouml:argouml-core:0.35.2-SNAPSHOT: Could not find artifact org.argouml:parentpom:pom:0.35.5-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 7, column 11 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

After some googling, I found that my x86_64 Macbook Pro had a populated ~/.m2/repository, while on the Mini it was unpopulated.

I fixed this by copying org/argouml/ & contents to the Mini's repository; all went fine after that.

But, how should I have set it up?

stcarrez commented 2 years ago

Hi Simon, I think the issue comes from a missing parentpom directory. I've checkout the sources by using repo with:

mkdir argouml
cd argouml
repo init -u git@github.com:argouml-tigris-org/manifest.git
repo sync

and then

cd argouml
mvn package

Having said that, each time I have to compile ArgoUML, I need to remember and fight again all these steps...

linustolke commented 2 years ago

I thought that the parentpom would be found at the sonatype site. Testing a little around this I get the feeling maven does not use the default sites to find the parent. I also found this discussion on stackoverflow that suggests this.

I have now attempted to fix this by explicitly adding the sonatype repo in the argouml-core pom. This will have to be updated when the parent pom changes to not being a snapshot anymore. It should then point to the released version of the parent pom instead.

Please comment on the fix here in GerritHub.

That takes care of the argouml project I think. If you think this is an OK solution, I will solve it in the same way in the other projects.

simonjwright commented 2 years ago

I renamed my ~/.m2, and got the same error as before.

linustolke commented 2 years ago

The change is not merged to master yet. Did you download it from gerrithub? git fetch https://github.com/argouml-tigris-org/argouml refs/changes/77/542277/1 && git checkout FETCH_HEAD

simonjwright commented 2 years ago

Thanks for that hint; now working very satisfactorily (I deleted ~/.m2, then built: massive downloading!)

And I should say, argouml/src/argouml-build/target/argouml-jar-with-dependencies.jar runs fine.

linustolke commented 2 years ago

OK. Great. Thanks. I will merge that change now and eventually start fixing the other projects.

linustolke commented 2 years ago

This is now fixed for all repositories. I have learned some things about the maven configuration.