On Tue, Apr 17, 2012 at 6:43 AM,  <chad.da...@emc.com> wrote:
> Our build has a dependency on the JRE.  In order to build our final 
> distribution artifact, we need a JRE.  To me, this means that the JRE should 
> be managed as a maven artifact in nexus.  Otherwise, I can't use the assembly 
> plugin to build my distribution.  I can't really find much on this on the 
> internet, though I do see a couple of people suggesting that it's a whacky 
> idea.
>
> Why is it whacky?  The JRE is a raw material upon which our build is 
> dependent, so how else should that be obtained?  Other ways of making it 
> available to the build don't seem better . . .
>
> How do other people solve this problem?

You get your customers to install a JRE themselves?

But you can do what you are suggesting if you want.

e.g. using XMLSpy as an example, since I had it lying around to install.

mvn install:file -Dfile=XMLSpyEnt2012.exe -DgroupId=test
-DartifactId=xmlspy -Dversion=1.0.0 -Dpackaging=exe

You can then reference this as:
<dependency>
  <groupId>test</groupId>
  <artifactId>xmlspy</artifactId>
  <version>1.0.0</version>
  <packaging>exe</version>
</dependency>

Once you have this working locally, you will want to upload this to
nexus and re-test.
You should also set a decent value for the GAV instead of the example
one I've provided.

Tested with the following 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>test</groupId>
  <artifactId>f</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <build>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/archive.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>


  <dependencies>
    <dependency>
      <groupId>test</groupId>
      <artifactId>xmlspy</artifactId>
      <version>1.0.0</version>
      <type>exe</type>
    </dependency>
  </dependencies>

</project>

And the following src/main/assembly/archive.xml assembly file
<assembly 
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
  <id>archive</id>
  <formats>
    <format>dir</format>
  </formats>
  <dependencySets>
    <dependencySet>
    </dependencySet>
  </dependencySets>
</assembly>

This created the assembly
target\f-0.0.1-SNAPSHOT-archive\f-0.0.1-SNAPSHOT\xmlspy-1.0.0.exe

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to