简体   繁体   English

编译java为.jar文件依赖

[英]Compile java to .jar file dependency

Ive found an opensource java application that i want to use to generate a document however i know very little about java and even less about maven.我找到了一个我想用来生成文档的开源 java 应用程序,但是我对 java 知之甚少,对 maven 知之甚少。

The project is Stencil Template Engine该项目是模板模板引擎

My plan is to include the above as a dependency in a spring boot mvc application so i can use the Java API to render a document, however my issues are:我的计划是将上述内容作为依赖项包含在 spring 引导 mvc 应用程序中,这样我就可以使用 Java API 来呈现文档,但是我的问题是:

  • The above project is not listed a maven so i cant import it.上面的项目没有列出 maven 所以我不能导入它。
  • i can see a number of.java files nested into subfolders which im assuming i need to compile to a.class file.我可以看到一些嵌套在子文件夹中的 .java 文件,我假设我需要编译为 .class 文件。 Attempts have failed尝试失败
  • Ive added the dependency to the pom.xml file as instructed in the readme but it errors because it cant find the jar file我已按照自述文件中的说明将依赖项添加到 pom.xml 文件中,但由于找不到 jar 文件而出错
  • I cant find a way to import maven dependencies listed in the pom file我找不到导入 pom 文件中列出的 maven 依赖项的方法
  • javac commands have all failed javac 命令全部失败

Could someone please recommend a way of cloning and building the above into a jar file,有人可以推荐一种将上述内容克隆并构建到 jar 文件中的方法,

Below is the text from README file of the github link you have.以下是您拥有的 github 链接的自述文件中的文本。

Try to add both maven repository and maven dependency in your pom.xml尝试在 pom.xml 中添加 maven 存储库和 maven 依赖项

For example add this in your existing pom xml:例如,在您现有的 pom xml 中添加:

<repositories>
    <repository>
        <id>clojars.org</id>
        <url>https://repo.clojars.org</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>io.github.erdos</groupId>
        <artifactId>stencil-core</artifactId>
        <version>0.3.29</version>
    </dependency>
</dependencies>

From README file从自述文件

Latest stable version is 0.3.29最新稳定版本为 0.3.29

Latest snapshot version is 0.3.30-SNAPSHOT最新的快照版本是 0.3.30-SNAPSHOT

If you are using Maven, add the followings to your pom.xml:如果您使用的是 Maven,请将以下内容添加到您的 pom.xml 中:

The dependency:依赖:

 <dependency> <groupId>io.github.erdos</groupId> <artifactId>stencil-core</artifactId> <version>0.3.29</version> </dependency>

And the Clojars repository: Clojars 存储库:

 <repository> <id>clojars.org</id> <url>https://repo.clojars.org</url> </repository>

Alternatively, if you are using Leiningen, add the following to the:dependencies section of your project.clj file: [io.github.erdos/stencil-core "0.3.29"]或者,如果您使用 Leiningen,请将以下内容添加到 project.clj 文件的:dependencies 部分:[io.github.erdos/stencil-core "0.3.29"]

Previous versions are available on the Stencil Clojars page. Stencil Clojars 页面上提供了以前的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM