Can´t get my interface file working

106 views
Skip to first unread message

Jonas Breisel

unread,
Oct 14, 2020, 11:26:32 AM10/14/20
to GraphWalker
I have generated an interface file and have the project structure set up accodring to your guidance in Intellij.

But it can´t find java in these three imports in the interface file.
import org.graphwalker.java.Edge;
import org.graphwalker.java.Vertex;
import org.graphwalker.java.Model;

I don´t understand what I am doing wrong?

Here is the part from my pom file that relates to graphwalker.

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.graphwalker</groupId>
<artifactId>graphwalker-core</artifactId>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>org.graphwalker</groupId>
<artifactId>graphwalker-io</artifactId>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>org.graphwalker</groupId>
<artifactId>graphwalker-java</artifactId>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>org.graphwalker</groupId>
<artifactId>graphwalker-maven-plugin</artifactId>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.2.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.graphwalker</groupId>
<artifactId>graphwalker-maven-plugin</artifactId>
<version>4.3.0</version>
<!-- Bind goals to the default lifecycle -->
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>generate-sources</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Kristian Karl

unread,
Oct 14, 2020, 12:27:46 PM10/14/20
to GraphWalker
Hi,

I assume:
  • You created the interfaces using mvn graphwalker:generate-sources
  • That when you are trying to extend those interfaces in Intellj, it can't find those interfaces?
When working with Intellij and things don't work out as expected (the whole world is red) like above, I usually try (from within Intellij)
  File Menu -> Invalidate Caches / Restart...

Let us know if it solves your problem. 

Jonas Breisel

unread,
Oct 14, 2020, 1:35:01 PM10/14/20
to GraphWalker
Hi!

Yes I did.

I tried your suggestion it solved the problem with java, now it can´t find Vertex, Model and Edge instead.

Kristian Karl

unread,
Oct 15, 2020, 3:09:42 AM10/15/20
to GraphWalker
Okay, halfway there then :-)

Your imports look wrong to me.
When GraphWalker generates the interfaces, the imports will look like:
import org.graphwalker.java.annotation.Model;
import org.graphwalker.java.annotation.Vertex;
import org.graphwalker.java.annotation.Edge;

A quick fix is to run:
mvn graphwalker:generate-sources
from the terminal window.

Note that the interface files are not to be edited manually. GraphWalker will overwrite those every time the the GraphWalker plugin generate-sources or generate-test-sources are run.

/Kristian

Jonas Breisel

unread,
Oct 15, 2020, 4:04:57 AM10/15/20
to GraphWalker
When I just tried the command mvn graphwalker:generate-sources , nothing happend with my interface file, but when I did a clean and then generete again it worked :-)

Thanks a lot for the help.

/Jonas

Hüseyin Aydın

unread,
Mar 29, 2023, 8:42:51 AM3/29/23
to GraphWalker
Hello,

If you encounter with this kind of situation and above solution does not work please go to Project Folder and click right -> Maven -> Generate Sources And Update Folders. I've found the solution at stackoverflow, you can checkout reference for more detail.
Reply all
Reply to author
Forward
0 new messages