matsim-org / matsim-code-examples

A repository containing code examples around MATSim
GNU General Public License v3.0
82 stars 178 forks source link

How to create a personalized project by matsim-example-code #1169

Open applibres opened 4 days ago

applibres commented 4 days ago

Dear @Janekdererste and MATSim friends:

I want to create a personalized version of electric vehicle (ev) contrib. I know that I can use the matsim-example-project, however I can not configure the POM.xml file properly.

Let me explain that I did:

1) Clone the matsim-example-project and follow the instructions given. 2) Copy the ev source code inside the project (image attached)

Screenshot 2024-10-03 at 11 29 14

3) I have copied ev-contrib dependencies into pom.xml (pom attached as txt)

pom.xml.txt

4) In Eclipse , go to Pom.xml -> Run As --> Maven Install

After that I got a long list of errors related to dependencies.

Am I on the right path? Please, could you suggest what I can do ?

Platform used: Eclipse + java 22.0.1

Thanks for your time.

Regards.

Janekdererste commented 4 days ago

I think copying all the code from the ev contrib into your project is not a good idea in general. Most often it is sufficient to point to the contrib as a dependency, which you do because you declare a dependency on the ev contrib in your pom.xml on line 126.

Then you can add your custom functionality on top of that.

I also noticed, that you have some dependecies in your pom.xml marked with "ev contrib dependencies". Dependencies in maven are transient, which means, that if you declare a dependency on the ev contrib, all dependencies of that module are automatically available in your project as well.

Maybe it would be helpful to describe what you want to achieve, and then we can give advice on how to proceed.