Apache Olingo是一個實現開放數據協定(OData)的Java庫。Apache Olingo服務於OData的客戶端和伺服器方面。它目前支持OData 2.0,也將支持OData 4.0。後者是協定的OASIS版本:OASIS開放數據協定(OData)TC。
基本介紹
- 外文名:Apache Olingo
V2版本使用方式:
Apache Olingo支持Maven原型,這整捆記是一種用於從頭開始疊達組設定新項目的項目模板茅鞏刪。目前存在一個具有ODataSingleProcessor實現olingo-odata2-sample-cars-service-archetype的原型和一個具有基於注釋的ODataService實現的原型olingo-odata2-sample-cars-annotation-archetype。
mvn archetype:generate \ -DinteractiveMode=false 嬸鍵\ -Dversion=1.0.0-SNAPSHOT \ -DgroupId=com.sample \ -DartifactId=my-car-service \ -DarchetypeGroupId=org.apache.olingo \ -DarchetypeArtifactId=olingo-odata2-sample-cars-service-archetype \ -DarchetypeVersion=RELEASETo generate the sample project for the ODataService implementation with use of the Java Annotations extension start with:mvn archetype:generate \ -DinteractiveMode=false \ -Dversion=1.0.0-SNAPSHOT \ -DgroupId=com.sample \ -DartifactId=my-car-service \ -DarchetypeGroupId=org.apache.olingo \ -DarchetypeArtifactId=olingo-odata2-sample-cars-annotation-archetype \ -DarchetypeVersion=RELEASEIf an archetype is not available via Maven standard configuration then an additional parameter -DarchetypeRepository=http://repository.apache.org/snapshots can solve the issue.Based on the Olingo project template Maven will generate a new project with the specified GAV*) coordinates: com.sample:my-car-service:1.0.0-SNAPSHOT. GAV 夜凳定霸coordinates can be freely chosen during generation with the interactive mode. To enable the interactive mode -DinteractiveMode must be set to true or omitted (to use Maven default setting of true).The result is a new and ready to build Maven project. Switch to my-car-service directory and execute:mvn clean installIf a Apache Olingo dependency is not available via Maven standard configuration than adding the Apache Maven Repository (or in case you want to use SNAPSHOTS the Apache Snapshot Repository) into your Maven settings.xml or the pom.xml of this project can solve the issue.… <repositories> <repository> <id>apache.central</id> 凝舉多 <name>Central Repository</name> <url>http://repo.maven.apache.org/maven2</url> </repository> <repository> <id>apache.snapshots<槳遙糊甩/id> <name>Apache SNAPSHOT Repository</name> <url>https://repository.apache.org/content/repositories/snapshots/</url> </repository> </repositories>…Maven will build the project with the result car-service.war in the Maven target directory which can be deployed to any JEE compliant web application server. To call the deployed and running OData service enter this URI in a browser:http://localhost:8080/my-car-service/Which show a entry page for the generated sample service with links to the Metadata ($metadata), Service Document and some sample data which it provides.*) GAV means a Maven groupId, artifactId and version.Eclipse IDE SupportThe archetype template supports Eclipse as IDE. Additionally to a Maven clean and install it is possible to call the following Maven goal:mvn eclipse:clean eclipse:eclipse