问题描述
如何在我的maven项目中包括Cplex JavaDoc,以获取Cplex Java API上的代码助手?
How can I include the Cplex JavaDoc in my maven project to get code assistant on the Cplex Java API?
推荐答案
可以在此处找到Javadoc:
The javadoc can be found here:
{PATH_TO_CPLEX_INSTALLATION_FOLDER}/doc/html/zh-CN/refjavacplex/html/
{PATH_TO_CPLEX_INSTALLATION_FOLDER}/doc/html/en-US/refjavacplex/html/
对于非Maven项目,您可以在项目设置中直接引用该路径.
For non maven projects you can reference that path directly in the project settings.
对于Maven项目,您可以将该文件放入javadoc jar文件中:打开命令行并导航到该文件夹,例如
For maven projects you can put that files into a javadoc jar file:Open the CommandLine and navigate to the folder, e.g.
然后创建javadoc jar文件:
Then create the javadoc jar file:
然后将创建的javadoc jar放在CPLEX库jar旁边,并在本地maven存储库中放置相应的pom文件,例如
Then put the created javadoc jar next to the CPLEX library jar and a corresponding pom file in your local maven repository, e.g.
{PROJECT_ROOT} \ maven_project_repository \ ilog \ cplex \ 1263 \
{PROJECT_ROOT}\maven_project_repository\ilog\cplex\1263\
- cplex-1263.jar
- cplex-1263-javadoc.jar
- pom.xml
例如pom文件
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>ilog.concert</groupId>
<artifactId>cplex</artifactId>
<version>1263</version>
</project>
在更新Maven依赖关系时,会自动将Javadoc与API一起检索.如果使用Eclipse,请在您的maven设置中设置用于下载javadoc文件的复选框:
On an update of the Maven Dependencies the javadoc is automatically retrieved together with the API. Set the checkbox for downloading javadoc files in your maven settings if you use Eclipse:
以下是一些片段,其中包括本地Maven存储库和CPLEX依赖项:
Here are some snippets for including the local maven repository and the CPLEX dependency:
<repositories>
<!-- Custom In-Project repository that contains dependencies that can not
be found on maven servers -->
<repository>
<id>maven_project_repository</id>
<name>Maven Project Repository Share</name>
<url>file://${project.basedir}/maven_project_repository</url>
</repository>
</repositories>
<dependencies>
<!-- cplex -->
<dependency> <!-- from in project maven repository -->
<groupId>ilog.concert</groupId>
<artifactId>cplex</artifactId>
<version>1263</version>
<scope>compile</scope>
</dependency>
</dependencies>
这篇关于如何在Maven项目中包含JavaDoc for CPLEX API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!