1

I have an eclipse project which I am using maven with. I am however using Xtend. I want to run the main method in the Xtend file however I am struggling.

Below is a picture of my directory structure:

My eclipse project setup

When I right click the project and click run as java application I am presented with the following code:

Run as java application

The issue is my main method is not available. The main method is in two files. The Xtend file AutomaticTester.xtend contains a main method.

The AutomaticTester.java file is the file that is generated by Xtend. Why can I not see the correct java main. Is this the correct way of running eclipse maven apps?

Below is also a copy of my pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>SeleniumTesting</groupId>
  <artifactId>SeleniumTesting</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>xtend-gen</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.eclipse.xtend</groupId>
        <artifactId>xtend-maven-plugin</artifactId>
        <version>2.9.0</version>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
        <groupId>org.eclipse.xtend</groupId>
        <artifactId>org.eclipse.xtend.lib</artifactId>
        <version>2.9.0</version>
    </dependency>
    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.11.0</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.53.0</version>
    </dependency>
  </dependencies>
</project>
KennyBartMan
  • 940
  • 9
  • 21
  • I've created a project with your pom.xml and it works as expected, e.g. I can run my main class. First, I recommend to use the standard Maven project layout for new projects. Second, there may be problems with your build path - at least it seems on your screenshot that the generated Java files are not on the build path. – snorbi May 02 '16 at 15:21

0 Answers0