Deployment – clojure / ring: how do I integrate my clojure application with a Java build process beyond my control?

I have a unique build situation I am using lein uberwar to build a war from my ring application and deploy it to beanstalk All this works Now it has a requirement that we need to push the code to an SVN repo, where they will manage the build. It knows nothing about clojure (only Java) This is a huge bureaucratic organization. Their construction process is in place, so it is impossible for them to install lein on their server at present I know lein uses Maven under the hood, so I know it can work in theory, but I still have questions about the steps of this process

I completed the process of building war in lein ring. The main problem I saw was the generation of servlet and listener classes and web xml. I think I can provide java files to perform this task, but I don't know what these java files will contain and what they will eventually exist in the project structure Look at the servlet generated in the final war Clj and listener The clj file looks simple. There may already be such an example?

Another major obstacle I see is that the war process calls clojure on the project namespace Core / compile, which generates all class files from clojure source Is there any way to trigger this compilation during Maven build? I almost imagine a Java class that converts the compiler to clojure Core / compile, but I'm not sure about the context of calling clojure from Java, not the opposite (the usual process direction), or how to insert this step into a basic Maven construction process

Any idea of where to start is the most popular! Thank you

Solution

View Zi Maven plugin You are in the POM of the subproject Specify it as a plug-in in XML and populate it with the same actions that the javac plug-in does in the rest of the project No one outside your project needs to know that clojure exists

Look at readme for details

<build>
  <plugins>
    <plugin>
      <groupId>org.cloudhoist.plugin</groupId>
      <artifactId>zi</artifactId>
      <version>0.5.5</version>
      <executions>
        <execution>
          <id>default-compile</id>
          <goals>
            <goal>compile</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <excludes>
          <exclude>**/test.clj</exclude>
        </excludes>
      </configuration>
    </plugin>
  </plugins>
</build>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>