SEPIA-Framework / sepia-assist-server

Core server of the SEPIA Framework responsible for NLU, conversation, smart-service integration, user-accounts and more.
https://sepia-framework.github.io/
MIT License
94 stars 15 forks source link

compile errors in master branch #35

Closed barrynl closed 1 year ago

barrynl commented 1 year ago

Hi everyone, I am interested in the SEPIA-Framework (both using and contributing) and decided to start with cloning the repository and trying to get it running on my local machine. However, there are compilation errors in the latest code on master branch in the class net.b07z.sepia.server.assist.tools.FuzzySearch. It cannot find classes in the com.willowtreeapps.fuzzywuzzy.diffutils package, but these do not seem to exist in the pom.xml. The dev or kotlin branches are quite behind the master branch, so I did not try those yet.

Can anyone give me a pointer on how to get this sepia-assist-server compiling and running?

Thanks in advance!

Barry

barrynl commented 1 year ago

Although Eclipse shows compile errors in the above mentioned class, doing a mvn clean install succeeds. I am not yet sure why it does not fail, but either the respective class is excluded from compilation or the willowtreeapps dependency is added in some other way than via the pom.xml.

barrynl commented 1 year ago

Aha, found the missing classes, they are written in kotlin and not compiled by Eclipse, but they are included in the maven build. Sorry for the spam. I will try to let Eclipse recognize these kotlin code.

barrynl commented 1 year ago

Adding the following maven-plugin to the pom.xml seems to solve the above issue:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/kotlin</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
fquirin commented 1 year ago

Welcome @barrynl :-)

I introduced Kotlin support explicitly for FuzzyWuzzy at some point and thought it would be nice to have in general, but it really makes a lot of problems in Eclipse unfortunately, especially since the Kotlin plugin for Eclipse breaks often :-/. Glad you found the solution.

The dev or kotlin branches are quite behind the master branch, so I did not try those yet.

The dev branch is actually always the most up-to-date, it just looks behind because of the PRs to the master that are not merged back. I think I should rebase it once.

Could you tell a bit more about the build-helper-maven-plugin, what it does or how it works? 🙂

barrynl commented 1 year ago

Hi @fquirin, aha, I understand.

The build-helper-maven-plugin is a Maven plugin that "contains various small independent goals to assist with the Maven build lifecycle." You can also use it to add additional source folders (in this case: src/main/kotlin) to a maven project. By using this plugin, together with the m2e buildhelper connector, the kotlin source folder is automatically added to the source folders of the Eclipse project instead of doing it manually (which would remove it again after Maven updates your project).

fquirin commented 1 year ago

Thanks for the info. I wonder though if this is not redundant or in conflict with the kotlin-maven-plugin, since this already compiles src/main/kotlin automatically 🤔. I usually don't have to add the Kotlin folder manually.

Do you have the Kotlin Plugin for Eclipse installed? (this one usually works better than the official one).

barrynl commented 1 year ago

I have the Kotlin Plugin installed, but I think I installed the official one. I'll try the one you mention and see if the kotlin source folder is automatically added to the project by that plugin.

barrynl commented 1 year ago

With both Kotlin Eclipse plugins I need to add the src/main/kotlin source directory to the build path once manually, but after that it keeps working correctly within Eclipse. You can try to reproduce it by removing the kotlin source folder from the build path manually and then close the project and reopen it and see if it automatically adds the kotlin source folder back to the build path. It does not do that for me without the build-helper-maven-plugin, but it does do that for me with the java source folder.