popbr / data-integration

Apache License 2.0
1 stars 4 forks source link

Fix application's name #11

Closed aubertc closed 2 years ago

aubertc commented 2 years ago

As of now, the application is called "com.mycompany.app.App". I'm sure we can come up with a better name than that, and propagate it efficiently everywhere.

We could begin by replacing mycompany with AugustaUniversity.

MNSleeper commented 2 years ago

Does that require anything more than simply changing the folder's name and any references to it in the execution statement?

aubertc commented 2 years ago

I don't know, the answer is probably somewhere in https://maven.apache.org/guides/introduction/introduction-to-the-pom.html BTW, "popbr" may be a better company name than AugustaUniversity.

aubertc commented 2 years ago

I can investigate if you want.

aubertc commented 2 years ago

Just to be clear: I was referring to this

https://github.com/popbr/data-integration/blob/83bbf12982483f0c8235aa66f817def4c9a6e892/Project/Database-IO/pom.xml#L7-L9

MNSleeper commented 2 years ago

I will change that, and report it that breaks anything.

MNSleeper commented 2 years ago

I ran into a myriad of problems when I changed the namein the pom. So, I made another Maven project, packaged it and such, but this time, the company is "popbr". It's name DatabaseIO this time, and all seems well. One problem I ran into, though, was that

java -cp target/DatabaseIO-1.0-SNAPSHOT.jar popbr.App

fails with the lines:

Error: Unable to initialize main class popbr.App Caused by: java.lang.NoClassDefFoundError: org/apache/poi/xssf/usermodel/XSSFWorkbook

Should I keep the new project, or undo it and leave the name as com.mycompany.App?

aubertc commented 2 years ago

java -cp target/DatabaseIO-1.0-SNAPSHOT.jar popbr.App

Why don't you run something like

mvn exec:java -Dexec.mainClass="com.mycompany.app.App"

where mycompany is popbr, or something of that nature, like we used to?

MNSleeper commented 2 years ago

I don't think I tried that specific command, so I will. However, I thought the "com.mycompany.app" part of that command correlates the the folder structure "main/java/com/mycompany/app/App.java". By changing one, you would have to change the other, right?

aubertc commented 2 years ago

Absolutely.

aubertc commented 2 years ago

BTW, https://maven.apache.org/guides/mini/guide-naming-conventions.html may be useful.

MNSleeper commented 2 years ago

Following that link, would we be following the naming conventions by doing just "popbr", or "AugustaUniversity.popbr"?

MNSleeper commented 2 years ago

Further along, should I keep the DatabaseIO Maven project that uses popbr, or the one that uses com.mycompany.app?

aubertc commented 2 years ago

The idea is to replace the meaningless "mycompany" with something meaningful.

aubertc commented 2 years ago

And we can probably use a more meaningful name than "app", too. The issue is not very precise, my apologies.

MNSleeper commented 2 years ago

I changed the name in pom.xml and the execution command and it works. Committing now. If anything breaks and we need to undo, I saved the entire project offline as another contingency aside from git's version control, just in case.

aubertc commented 2 years ago

It seems to be working just fine, but if I am not mistaken the application is still called "App", since we call it with

mvn exec:java -Dexec.mainClass="popbr.App"

We should give the testing application and the "actual" application more meaningful names, don't you think? You are actually using a different name in the pom, if I am not mistaken:

  <artifactId>Database-IO</artifactId>

You should propagate that name accordingly (provided artifactid = application name, something I'm not sure of).

But, ok, the name of the organization is settled.

MNSleeper commented 2 years ago

The Application's name has been changed

aubertc commented 2 years ago

Shouldn't you delete the folder https://github.com/popbr/data-integration/tree/main/Project/Database-IO/src/test/java/com/mycompany/app ?

aubertc commented 2 years ago

or rename it?

MNSleeper commented 2 years ago

That's odd; I deleted it on my side, and added that change to my commits a few commits ago.

aubertc commented 2 years ago

I don't think you "git deleted" it, it's still in the repo: https://github.com/popbr/data-integration/tree/main/Project/Database-IO/src/test/java/com/mycompany/app

Deleting it on your computer does not propagate onto the repo.

MNSleeper commented 2 years ago

Ah, I didn't realize that. Would I delete the directory directly in Git?

aubertc commented 2 years ago

You can use the web interface or the command line,

git rm -r Project/Database-IO/src/test/java/com/mycompany/app/

I ran it for you with https://github.com/popbr/data-integration/commit/79331216037c4245b13b57651168ed55cf97a72e

MNSleeper commented 2 years ago

I appreciate that, and thank you for the command for future reference.

aubertc commented 2 years ago

The name in the Installation_Test folder has not been changed.

MNSleeper commented 2 years ago

The app and foldernames have been changed. The Installation_Test/src/Test.... folder has been deleted. I housed some old test app that serves no purpose now whatsoever.

aubertc commented 2 years ago

Ok, I'll have to fix the github compilation's scheme at some point: please leave this issue open.

aubertc commented 2 years ago

Ok, we can now close this I believe, after https://github.com/popbr/data-integration/commit/ebe483f172174503f3caebb97edb1e987c41ade9.