How to use DukeScript with Eclipse?

Is there a tutorial on using DukeScript with Eclipse? I can only find a description for use with NetBeans.

+4
source share
3 answers

Now I spent several hours trying to start a Dukescript project. As a non-NetBeans user, I generated a project from the Maven archetype and then tried to import it into Eclipse. One of the problems is that m2eclipse gets confused with the html4j-maven-plugin, it does not know at what phase of the build life cycle it should work (as far as I understand). So I added the following:

  <pluginManagement>
<plugins>
  <!--This plugin configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
  <plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
        <lifecycleMappingMetadata>
            <pluginExecutions>
                <pluginExecution>
                    <pluginExecutionFilter>
                        <groupId>org.netbeans.html</groupId>
                        <artifactId>
                            html4j-maven-plugin
                        </artifactId>
                        <versionRange>[1.1,)</versionRange>
                        <goals>
                            <goal>process-js-annotations</goal>
                        </goals>
                    </pluginExecutionFilter>
                    <action>
                        <execute></execute>
                    </action>
                </pluginExecution>
            </pluginExecutions>
        </lifecycleMappingMetadata>
    </configuration>
  </plugin>
</plugins>

m2eclipse . , Eclipse (), . //-/ . , , . , . , , :

Exception in thread "main" java.util.ServiceConfigurationError: org.netbeans.html.boot.spi.Fn$Presenter: Provider org.netbeans.html.boot.fx.FXPresenter could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:224)
at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377)
at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
at net.java.html.boot.BrowserBuilder.showAndWait(BrowserBuilder.java:275)
at javelin.Main.main(Main.java:14)
Caused by: java.lang.UnsupportedClassVersionError: javafx/application/Platform : Unsupported major.minor version 52.0

, - . , .

! java 8

      <configuration>
          <source>1.8</source>
          <target>1.8</target>
      </configuration>

java runtime .project

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">

, , browser.rootdir, -. :

String userdir = System.getProperty("user.dir") + "/src/main/webapp";
System.setProperty("browser.rootdir", userdir ); 

, - . , .

2

Eclipse DukeScript , : m2e-apt. , pom :

<plugin>   
   <groupId>org.bsc.maven</groupId>   
      <artifactId>maven-processor-plugin</artifactId>   
      <version>2.2.4</version>   
      <executions>   
         <execution>   
           <id>process</id>   
             <goals>   
               <goal>process</goal>   
             </goals>   
             <configuration>
                <outputDirectory>target/generated-sources/annotations</outputDirectory>
            </configuration> 
          </execution>   
        </executions>   
        <dependencies>   
          <dependency>
            <groupId>org.netbeans.html</groupId>
            <artifactId>html4j-maven-plugin</artifactId>
            <version>${net.java.html.version}</version>
          </dependency>
         </dependencies>   
</plugin> 
+1

, . , "mvn clean install", . Eclipse , , , .

+1

Update: I wrote a short tutorial . Please let me know if this works for you and what needs to be improved.

0
source

All Articles