MAVEN + YAJSW plugin

Jai Gharge
2010-04-15
2013-06-12
  • Jai Gharge
    Jai Gharge
    2010-04-15

    I wanted to know a maven plugin for YAJSW, I have a product, which is a server made in java.
    Also I could successfully create a service for my java application.
    But I wanted wrapper.jar and various other JAR files which YAJSW uses to be included in my project through MAVEN.
    Can you point me to a MAVEN plugin which when i do my build it will download the latest YAJSW JAR files from its repository?
    Please help me on this as its very urgent requirement.

    Thanks,
    Jai

     
  • rzo
    rzo
    2010-04-15

    hello,

    currently i am not aware of a maven plugin for yajsw.
    there seems to something similar for JSW:

    http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/usage_jsw.html

    is this what you are looking for ?

    it should be possible to adapt this plugin for yajsw.

    • Ron
     
  • Jai Gharge
    Jai Gharge
    2010-04-16

    Yes you are right that there is a plugin for JSW, but as JSW is under GPL I didnt use it and implemented services using YAJSW.
    "it should be possible to adapt this plugin for yajsw"- This is what all i want to know can you help me on this?
    My client wants a MAVEN plugin for YAJSW so whenever we take a build we can get the latest JAR files of YAJSW from MAVEN repository itself.
    Please help me on this point.

    Thanks,
    Jai

     
  • rzo
    rzo
    2010-04-16

    hello,

    i have no experience with maven and maven plugins. therefore i will need some time to look into this.
    i will put this on the todo list. but, currently i am unable to estimate when i will have this ready.

    is someone in the community able to help ?

    • ron
     
  • Jai Gharge
    Jai Gharge
    2010-04-19

    Hi Ron,

    Thanks for your efforts I would be waiting for your reply on this.
    This would also be a plus point for YAJSW if you could find a MAVEN plugin for it, now a days many of your customer uses MAVEN but not able to download YAJSW JAR's from its plugin.
    Keep in touch and reply.

    Thanks,
    Jai

     
  • Jai Gharge
    Jai Gharge
    2010-04-19

    Also wanted to know is it possible to get source code of YAJSW? If yes then can you point me to a link or a repository?

    Cheers,
    Jai

     
  • Jai Gharge
    Jai Gharge
    2010-04-19

    "the complete source is included the downloadable zip file" - the ZIP contains only class files can i get access to Java files?

     
  • Jai Gharge
    Jai Gharge
    2010-04-20

    Hi Ron,

    I am tryin to compile your source code Java files through MAVEN, so i wanted to know which external JAR's u had added in your classpath, or which other JAR's are required to compile your Java source code so that i can then add them as dependency in my MAVEN project?

    Thnx,
    Jai

     
  • rzo
    rzo
    2010-04-20

    hello,

    all required jars are in the lib/core and lib/extended folders and their subfolders.

    • Ron
     
  • Jai Gharge
    Jai Gharge
    2010-04-22

    Hi Ron,

    From where did u download all these JAR files from LIB folder because I downloaded JNA 3.2.1.JAR and JNA 3.2.2.JAR from Maven repository but your JNA.JAR is very different from those 2 that i mentioned above.
    As i said i cannot add the lib JAR's directly in my MAVEN but i wanted those to be downloaded through its plugin.
    Do you update your JAR's of Lib folder regularly in every release?
    Can u point me to a location from where you download those JAR's n specially jna.jar?
    What is the use of jnax jnaxx and jnaxxx files?

    Thanks,
    Jai Gharge

     
  • rzo
    rzo
    2010-04-22

    Hello,

    JNA is taken from here:

    https://jna.dev.java.net/servlets/ProjectDocumentList?folderID=11817&expandFolder=11817&folderID=11911

    the x,xx etc files are old and should not have made it into the release. I will remove those with the next update.

    note that apache commons configuration and apache commons vfs jar files were created from subversion snapshot and are not available as jar files on the net.

    note also that lib/extended/vfs-webdav/jackrabbit-webdav-1.5.6.jar is a subset of the files from the according jackrabbit release, containing only files required for the webdav protokol. you need this file only if you intend to use the webdav functionality.

    i think that in order to be able to use maven you will need to create your own maven repository using a tool like artifactory or nexus.

    • ron
     
  • Ellis Breen
    Ellis Breen
    2012-04-13

    Hi, I am working on a Maven port of yajsw, which works at least on Windows so far. Most of the lib dependencies are available from various Maven repos, apart from Abeille, which I created my own POM for (and placed in my own Nexus repository). Having a bit of trouble getting the classpath definitions right, but getting there slowly. I could place the code on Github if anyone is interested, although it's far from production ready.

    I noticed that the neo4j project had a Maven port of yajsw, although it seems heavily tied in to the neo4j build process, sadly. Couldn't really see how it unpacks the libs etc.

     
  • Ellis Breen
    Ellis Breen
    2012-04-13

    Here is what I have so far:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.rzo</groupId>
    <artifactId>yajsw</artifactId>
    <version>11.0</version>
    <packaging>pom</packaging>
    <dependencies>

    <dependency>
    <groupId>commons-daemon</groupId>
    <artifactId>commons-daemon</artifactId>
    <version>1.0.10</version>
    </dependency>

    <dependency>
    <groupId>commons-configuration</groupId>
    <artifactId>commons-configuration</artifactId>
    <version>1.7-SNAPSHOT</version>
    </dependency>
    <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-cli</artifactId>
    <version>2.0-SNAPSHOT</version>
    </dependency>
    <dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>1.3.1</version>
    </dependency>
    <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-vfs</artifactId>
    <version>2.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-vfs2</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>1.8.6</version>
    </dependency>
    <dependency>
    <groupId>net.java.dev.jna</groupId>
    <artifactId>jna</artifactId>
    <version>3.4.0</version>
    </dependency>

    <dependency>
    <groupId>net.java.dev.jna</groupId>
    <artifactId>platform</artifactId>
    <version>3.4.0</version>
    </dependency>
    <dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty</artifactId>
    <version>3.3.1.Final</version>
    </dependency>

    <dependency>
    <groupId>jrexx</groupId>
    <artifactId>jrexx</artifactId>
    <version>1.1.1</version>
    </dependency>
    <dependency>
    <groupId>org.rzo</groupId>
    <artifactId>ahessian</artifactId>
    <version>yajsw.11.0</version>
    </dependency>

    <dependency>
    <groupId>org.quartz-scheduler</groupId>
    <artifactId>quartz</artifactId>
    <version>1.8.0</version>
    </dependency>
    <dependency>
    <groupId>org.apache.velocity</groupId>
    <artifactId>velocity</artifactId>
    <version>1.6.3</version>
    </dependency>

    <dependency>
    <groupId>com.caucho</groupId>
    <artifactId>hessian</artifactId>
    <version>4.0.7</version>
    </dependency>

    <dependency>
    <groupId>com.jgoodies</groupId>
    <artifactId>forms</artifactId>
    <version>1.2.0</version>
    </dependency>
    <dependency>
    <groupId>net.java.dev.glazedlists</groupId>
    <artifactId>glazedlists_java15</artifactId>
    <version>1.8.0</version>
    </dependency>
    <dependency>
    <groupId>com.jeta.abeille</groupId>
    <artifactId>forms</artifactId>
    <version>1.0</version>
    </dependency>

    </dependencies>
    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>

    <configuration>
    <source>1.6</source>
    <target>1.6</target>
    </configuration>
    </plugin>
    <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.5</version>
            <executions>
              <execution>
                <id>copy-resources</id>
                <!- here the phase you need ->
                <phase>validate</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/target/templates</outputDirectory>
                  <resources>         
                    <resource>
                      <directory>${basedir}/templates</directory>
                      <filtering>true</filtering>
                    </resource>
                  </resources>             
                </configuration>           
              </execution>
            </executions>
          </plugin>
    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
    <execution>
    <id>add-source</id>
    <phase>generate-sources</phase>
    <goals>
    <goal>add-source</goal>
    </goals>
    <configuration>
    <sources>
    <source>${basedir}/src/app/java</source>
    <source>${basedir}/src/ahessian</source>
    <source>${basedir}/src/build/java</source>
    <source>${basedir}/src/hessian</source>
    </sources>
    </configuration>
    </execution>
    <execution>
                <id>add-resource</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>add-resource</goal>
                </goals>
                <configuration>
                  <resources>
                    <resource>
                      <directory>templates</directory>
                      <targetPath>templates</targetPath>
                      <includes>
                        <include>**/*</include>
                      </includes>
                    </resource>
                  </resources>
                </configuration>
              </execution>
    </executions>
    </plugin>
    <plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.1</version>
    <executions>
    <execution>
    <id>package-with-dependencies</id>
    <phase>package</phase>
    <goals>
    <goal>single</goal>
    </goals>

    </execution>
    </executions>
    <configuration>
    <descriptor>src/assemble/bin.xml</descriptor>
    <archive>
          <manifest>
            <mainClass>org.rzo.yajsw.boot.WrapperExeBooter</mainClass>
            <addClasspath>true</addClasspath>
          </manifest>
        </archive>
    </configuration>

    </plugin>

    </plugins>

    <pluginManagement>
    <plugins>
    <!-This plugin's configuration is used to store Eclipse m2e settings
    only. It has no influence on the Maven build itself. ->
    <plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
    <lifecycleMappingMetadata>
    <pluginExecutions>
    <pluginExecution>
    <pluginExecutionFilter>
    <groupId>
    org.codehaus.mojo
    </groupId>
    <artifactId>
    build-helper-maven-plugin
    </artifactId>
    <versionRange>
    [1.7,)
    </versionRange>
    <goals>
    <goal>add-source</goal>
    <goal>add-resource</goal>
    </goals>
    </pluginExecutionFilter>
    <action>
    <ignore></ignore>
    </action>
    </pluginExecution>
    </pluginExecutions>
    </lifecycleMappingMetadata>
    </configuration>
    </plugin>
    </plugins>
    </pluginManagement>

    <resources>
          <resource>
            <directory>templates</directory>
            <includes><include>**/*</include>
            </includes>
          </resource>
     
        </resources>
    </build>
    <repositories>

    <repository>
    <id>Releases</id>

    <url>http://192.168.6.242:8082/nexus/content/repositories/releases</url>
    </repository>
    <repository>
    <id>Apache Snapshots Proxy</id>

    <url>http://192.168.6.242:8082/nexus/content/repositories/apache-snapshots/</url>
    </repository>
    <repository>
    <id>Apache Snapshots</id>
    <url>https://repository.apache.org/content/groups/snapshots/</url>

    </repository>
    </repositories>

    </project>

     
  • rzo
    rzo
    2012-04-13

    hello,

    great news !

    could you pls give access to the code on github.

    thanks

    • Ron
     
  • Ellis Breen
    Ellis Breen
    2012-04-13

    OK, trying to set it up now…

     
  • Ellis Breen
    Ellis Breen
    2012-04-13

    While Eclipse is chugging away, I thought I'd just clarify, this is just a Maven definition of the yajsw build process at the moment. No plugin-style integration (yet).

     
  • Ellis Breen
    Ellis Breen
    2012-04-13

    OK… here is the first draft:

    https://github.com/griels/yajsw-maven

    At the moment you will need to install abeille as a local maven artifact or deploy it to a repository (nexus works fine here). If this is a vital component of yajsw then it would be good to get this onto a public maven repo.

     
  • Ellis Breen
    Ellis Breen
    2012-04-13

    Hmm… I just noticed that this project uses Gradle as a build system. Not very au fait with that (although by many accounts it's a better build system), but it doesn't look difficult to add a capability to generate Maven artifacts:

    http://gradle.org/docs/current/userguide/maven_plugin.html

    Maybe you could borrow my dependency definitions to your Gradle build scripts to make it a nice, clean separation between source code and dependencies?

    Would be good to have a version-controlled official repository for the YAJSW code, although I'm happy to host my own for now.

     
  • rzo
    rzo
    2012-04-16

    hello,

    thanks a ton for your efforts.
    personally i prefer gradle to maven.
    but there are many, especially corporations, which use maven.
    i will need some time to look into this.

    what i am most hoping for is a maven plugin to generate configuration file for applications.

    • Ron
     
  • Ellis Breen
    Ellis Breen
    2012-04-16

    Great, thanks. I did have a quick look at Gradle and the plugin mentioned, but being an IDE junkie, gave up when I couldn't get the Gradle-Eclipse integration plugins to work. I guess a lot of corps like Maven for this reason too. I'll have another go, though.

    A Maven plugin would secure pole position for YAJSW, I think. Not much else it doesn't integrate with! Maybe one day I will have time to work on one.

     
  • JohnnyBoy
    JohnnyBoy
    2012-08-17

    The Mark 2 project on GitHub seems to have come on a long way:
    https://github.com/griels/yajsw-maven-mk2#readme

    There seems to be a plugin directory in the source but I'm not clear on how to use it.
    Has it been published to maven central yet?

     
  • Ellis Breen
    Ellis Breen
    2012-08-17

    Hi, the main work was the packaging, the plugin isn't really done yet.

    I was just trying to neatly factor in the config generation stuff
    without too much intrusion into the yajsw codebase. I don't strictly
    need it for my purposes, but it would certainly tidy stuff up. I've
    already managed to get a list of artifacts from the runtime classpath
    (in Maven groupId:artifactId format rather than hard-coded
    directories), so I was thinking I could make the Maven repository
    location it references relative to an environment variable or property
    in a file somewhere. Ideally it would be possible to just publish a
    portable config file that could be used anywhere by just setting an
    argument on environment variable.

    Any thoughts on this?

    Thanks,

    Ellis

     
  • Ellis Breen
    Ellis Breen
    2012-08-17

    P.S. there is a Maven repo at http://griels.github.com/yajsw-maven-mk2/repo/ , but it's only occasionally updated. I'll update it when/if I've done the plugin.