e4 RAP 응용 프로그램을 제공하고자하는 e4 RCP 제품이 있습니다. 다음e4 RAP 응용 프로그램의 war 파일을 빌드하고 배포하는 방법
public class BasicApplication implements ApplicationConfiguration {
public void configure(Application application) {
Map<String, String> properties = new HashMap<String, String>();
properties.put(WebClient.PAGE_TITLE, "My RAP Application");
Bundle bundle = FrameworkUtil.getBundle(my.package.E4LifeCycle.class);
String symbolicName = bundle.getSymbolicName();
String appXmiLocation = "platform:/plugin/" + symbolicName + "/Application.e4xmi";
String lifeCycleLocation = "bundleclass://" + symbolicName + "/" + my.package.E4LifeCycle.class.getName();
E4ApplicationConfig applicationConfig = E4ApplicationConfig.create(appXmiLocation, lifeCycleLocation);
E4EntryPointFactory entryPointFactory = new E4EntryPointFactory(applicationConfig);
application.addEntryPoint("/myapp", entryPointFactory, properties);
application.setOperationMode(OperationMode.SWT_COMPATIBILITY);
}
}
: 따라서, 나는 OSGI-INF 폴더에 contribution.xml에 선언 된 org.eclipse.rap.rwt.application.ApplicationConfiguration 인터페이스, 다음과 같은 구현을 기여하는 새로운 OSGi 번들을 추가 예제 here, 필자는 필요한 플러그인을 포함하고 필요한 모든 Eclipse 관련 플러그인/기능 (e4, rap, rwt, osgi 등)에 따라 새로운 기능 번들을 만들었습니다. 참조 된 assembly.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>
<artifactId>my.app.rap.feature</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<parent>
<groupId>my.app</groupId>
<artifactId>my.app.parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../releng/my.app.parent</relativePath>
</parent>
<properties>
<output.directory>${basedir}/target/WEB-INF</output.directory>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<deployableFeature>true</deployableFeature>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-web-inf</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${output.directory}</outputDirectory>
<resources>
<resource>
<directory>${basedir}/templates/WEB-INF</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-plugins</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${output.directory}/eclipse</outputDirectory>
<resources>
<resource>
<directory>${basedir}/target/site</directory>
<includes>
<include>*/**</include>
</includes>
<excludes>
<exclude>*.jar</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<finalName>my-app</finalName>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>verify</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
:에서
<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>my.app</groupId>
<artifactId>my.app.parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tycho.version>0.25.0</tycho.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-versions-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>eclipse-RAP</id>
<url>http://download.eclipse.org/rt/rap/3.1</url>
<layout>p2</layout>
</repository>
<repository>
<id>eclipse-RAP-e4</id>
<url>http://download.eclipse.org/rt/rap/incubator/nightly/e4/target/site</url>
<layout>p2</layout>
</repository>
<repository>
<id>neon-orbit</id>
<url>http://download.eclipse.org/tools/orbit/downloads/drops/R20160520211859/repository/</url>
<layout>p2</layout>
</repository>
</repositories>
</project>
: 완성도를 들어
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>rap</id>
<formats>
<format>war</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${output.directory}</directory>
<outputDirectory>/WEB-INF</outputDirectory>
</fileSet>
</fileSets>
</assembly>
, 여기에 부모의 pom.xml 파일입니다 그것은이 pom.xml 파일을 포함 templates/WEB-INF WAR products 도구로 생성 된 launch.xml과 web.xml을 넣었습니다.
는# Eclipse Runtime Configuration Overrides
# These properties are loaded prior to starting the framework and can also be used to override System Properties
# @null is a special value used to override and clear the framework's copy of a System Property prior to starting the framework
# "*" can be used together with @null to clear System Properties that match a prefix name.
osgi.*[email protected]
org.osgi.*[email protected]
eclipse.*[email protected]
osgi.parentClassloader=app
osgi.contextClassLoaderParent=app
빌드가 성공하고 전쟁 파일이 생성됩니다 :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app id="WebApp">
<servlet id="bridge">
<servlet-name>equinoxbridgeservlet</servlet-name>
<display-name>Equinox Bridge Servlet</display-name>
<description>Equinox Bridge Servlet</description>
<servlet-class>org.eclipse.equinox.servletbridge.BridgeServlet</servlet-class>
<!-- Framework Controls could be useful for testing purpose, but
we disable it per default -->
<init-param>
<param-name>enableFrameworkControls</param-name>
<param-value>false</param-value>
</init-param>
<!-- Enable multi-language support for the extension registry -->
<!-- the OSGi console is useful for trouble shooting but will fill up your
appserver log quickly, so deactivate on production use. Uncomment
the -console parameter to enabled OSGi console access. -->
<init-param>
<param-name>commandline</param-name>
<param-value>-registryMultiLanguage <!-- -console --></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>equinoxbridgeservlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
launch.ini 반면, 다음과 같은 경우 : web.xml은 다음과 같습니다. 나는 그것을 Tomcat의 webapps dir에 넣었고 자동으로 압축이 풀렸다. 하지만 브라우저에서 http : // localhost : 8080/my-app-rap을 지정하면 404가 생깁니다. 따라서 어떤 시작점을 사용하여 어딘가에 누락 된 구성을 가정합니다. 이걸 알아낼 수있게 도와 줄 수 있니? HTTP : 당신이 액세스하려는 주소를 변경
어떤 힌트가? – ErnstZ