diff --git a/cmake/java.cmake b/cmake/java.cmake index fb4ef2915e..be9d26c7d1 100644 --- a/cmake/java.cmake +++ b/cmake/java.cmake @@ -84,9 +84,14 @@ endforeach() #################### ## Java package ## #################### -file(GENERATE - OUTPUT java/pom.xml - INPUT ortools/java/pom.xml.in) +file(GENERATE OUTPUT java/pom.xml + CONTENT + "FILE(READ ${PROJECT_SOURCE_DIR}/ortools/java/pom.xml.in input) +STRING(REPLACE \"@PROJECT_VERSION@\" \"${PROJECT_VERSION}\" input \"\${input}\") +STRING(REPLACE \"@ortools@\" \"$\" input \"\${input}\") +STRING(REPLACE \"@native@\" \"$\" input \"\${input}\") +FILE(WRITE java/pom.xml \"\${input}\")" +) # Main Target add_custom_target(java_package ALL diff --git a/ortools/java/pom.xml.in b/ortools/java/pom.xml.in index a5d72496b0..7f8ba5913c 100644 --- a/ortools/java/pom.xml.in +++ b/ortools/java/pom.xml.in @@ -1,22 +1,43 @@ + + -4.0.0 -com.google.ortools -ortools-java -${PROJECT_VERSION} - - - com.google.protobuf - protobuf-java - 3.11.2 - - - - ${project.basedir} - ${project.build.directory}/lib - ${project.basedir}/ortools - + 4.0.0 + + com.google.ortools + ortools + jar + @PROJECT_VERSION@ + + OR-Tools + https://developers.google.com/optimization/ + + + UTF-8 + 1.8 + 1.8 + + + + + com.google.protobuf + protobuf-java + 3.11.2 + + + junit + junit + 4.11 + test + + + + + ${project.basedir} + ${project.build.directory}/lib + ${project.basedir}/ortools +