You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mike Calmus <mi...@calmus.org> on 2011/01/11 21:22:58 UTC

creating a small non-primary war

 I am trying to create a non-primary war that includes an applet jar and its
dependencies. This war is then merged into a larger war.

When I try to do this, though I get an error from the Maven Install plugin
indicating no primary artificat was created. The error returend is somewhat
different depending upon the plugin versions involved.

Here's what I have. Is there some better way to do this, or is this a bug in
one of the plugins or both? Thanks.

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>my.test.group</groupId>
  <artifactId>mytest-applet-war</artifactId>
  <packaging>war</packaging>
  <version>1.0</version>
  <name>My Test Applet War</name>
  <properties>

<applet.directory>${project.build.directory}/${project.build.finalName}/applet</applet.directory>
  </properties>
  <dependencies>
    <dependency>
      <groupId>my.test.group</groupId>
      <artifactId>mytest-applet</artifactId>
      <version>1.0</version>
      <type>jar</type>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <primaryArtifact>false</primaryArtifact>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${applet.directory}</outputDirectory>
              <stripVersion>true</stripVersion>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Re: creating a small non-primary war

Posted by Anders Hammar <an...@hammar.net>.
And that's because you've configured the war plugin not to make it a primary
artifact. Remove that.

/Anders (mobile)
Den 12 jan 2011 16.56 skrev "Mike Calmus" <mi...@calmus.org>:
> That's what I am doing. The initial war that has the applet pieces is the
> thing that fails when the install plugin tries to do its thing because the
> war plugin seems not to be providing a main artifact to it.
>
>
>> Anders Hammar
>> Tue, 11 Jan 2011 23:09:31 -0800
>>
>> Why isn't the war the primary artifact?
>> I would suggest you structure this as two modules; the first creates the
war
>> that includes the applet and the other one is the larger war.
>>
>> /Anders
>>
>> On Tue, Jan 11, 2011 at 21:22, Mike Calmus <m....@calmus.org> wrote:
>>
>> > I am trying to create a non-primary war that includes an applet jar and
>> > its
>> > dependencies. This war is then merged into a larger war.
>> >
>> > When I try to do this, though I get an error from the Maven Install
plugin
>> > indicating no primary artificat was created. The error returend is
somewhat
>> > different depending upon the plugin versions involved.
>> >
>> > Here's what I have. Is there some better way to do this, or is this a
bug
>> > in
>> > one of the plugins or both? Thanks.
>> >
>> > <project xmlns="http://maven.apache.org/POM/4.0.0" <
http://maven.apache.org/POM/4.0.0%22>;
>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <
http://www.w3.org/2001/XMLSchema-instance%22>;
>> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> > http://maven.apache.org/maven-v4_0_0.xsd" <
http://maven.apache.org/maven-v4_0_0.xsd%22>;>
>> > <modelVersion>4.0.0</modelVersion>
>> > <groupId>my.test.group</groupId>
>> > <artifactId>mytest-applet-war</artifactId>
>> > <packaging>war</packaging>
>> > <version>1.0</version>
>> > <name>My Test Applet War</name>
>> > <properties>
>> >
>> >
>> >
<applet.directory>${project.build.directory}/${project.build.finalName}/applet</applet.directory>
>> > </properties>
>> > <dependencies>
>> > <dependency>
>> > <groupId>my.test.group</groupId>
>> > <artifactId>mytest-applet</artifactId>
>> > <version>1.0</version>
>> > <type>jar</type>
>> > <scope>provided</scope>
>> > </dependency>
>> > </dependencies>
>> > <build>
>> > <plugins>
>> > <plugin>
>> > <groupId>org.apache.maven.plugins</groupId>
>> > <artifactId>maven-war-plugin</artifactId>
>> > <configuration>
>> > <primaryArtifact>false</primaryArtifact>
>> > <failOnMissingWebXml>false</failOnMissingWebXml>
>> > </configuration>
>> > </plugin>
>> > <plugin>
>> > <groupId>org.apache.maven.plugins</groupId>
>> > <artifactId>maven-dependency-plugin</artifactId>
>> > <executions>
>> > <execution>
>> > <phase>process-resources</phase>
>> > <goals>
>> > <goal>copy-dependencies</goal>
>> > </goals>
>> > <configuration>
>> > <outputDirectory>${applet.directory}</outputDirectory>
>> > <stripVersion>true</stripVersion>
>> > </configuration>
>> > </execution>
>> > </executions>
>> > </plugin>
>> > </plugins>
>> > </build>
>> > </project>
>> >
>>
>>

Re: creating a small non-primary war

Posted by Wayne Fay <wa...@gmail.com>.
> thing that fails when the install plugin tries to do its thing because the
> war plugin seems not to be providing a main artifact to it.

>> >        <groupId>org.apache.maven.plugins</groupId>
>> >        <artifactId>maven-war-plugin</artifactId>
>> >        <configuration>
>> >          <primaryArtifact>false</primaryArtifact>

Maven is simply doing what you instructed it to do here.

Wayne

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


Re: creating a small non-primary war

Posted by Mike Calmus <mi...@calmus.org>.
That's what I am doing. The initial war that has the applet pieces is the
thing that fails when the install plugin tries to do its thing because the
war plugin seems not to be providing a main artifact to it.


> Anders Hammar
> Tue, 11 Jan 2011 23:09:31 -0800
>
> Why isn't the war the primary artifact?
> I would suggest you structure this as two modules; the first creates the war
> that includes the applet and the other one is the larger war.
>
> /Anders
>
> On Tue, Jan 11, 2011 at 21:22, Mike Calmus <m....@calmus.org> wrote:
>
> >  I am trying to create a non-primary war that includes an applet jar and
> > its
> > dependencies. This war is then merged into a larger war.
> >
> > When I try to do this, though I get an error from the Maven Install plugin
> > indicating no primary artificat was created. The error returend is somewhat
> > different depending upon the plugin versions involved.
> >
> > Here's what I have. Is there some better way to do this, or is this a bug
> > in
> > one of the plugins or both? Thanks.
> >
> > <project xmlns="http://maven.apache.org/POM/4.0.0" <http://maven.apache.org/POM/4.0.0%22>;
> >         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <http://www.w3.org/2001/XMLSchema-instance%22>;
> >         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd" <http://maven.apache.org/maven-v4_0_0.xsd%22>;>
> >  <modelVersion>4.0.0</modelVersion>
> >  <groupId>my.test.group</groupId>
> >  <artifactId>mytest-applet-war</artifactId>
> >  <packaging>war</packaging>
> >  <version>1.0</version>
> >  <name>My Test Applet War</name>
> >  <properties>
> >
> >
> > <applet.directory>${project.build.directory}/${project.build.finalName}/applet</applet.directory>
> >  </properties>
> >  <dependencies>
> >    <dependency>
> >      <groupId>my.test.group</groupId>
> >      <artifactId>mytest-applet</artifactId>
> >      <version>1.0</version>
> >      <type>jar</type>
> >      <scope>provided</scope>
> >    </dependency>
> >  </dependencies>
> >  <build>
> >    <plugins>
> >      <plugin>
> >        <groupId>org.apache.maven.plugins</groupId>
> >        <artifactId>maven-war-plugin</artifactId>
> >        <configuration>
> >          <primaryArtifact>false</primaryArtifact>
> >          <failOnMissingWebXml>false</failOnMissingWebXml>
> >        </configuration>
> >      </plugin>
> >      <plugin>
> >        <groupId>org.apache.maven.plugins</groupId>
> >        <artifactId>maven-dependency-plugin</artifactId>
> >        <executions>
> >          <execution>
> >            <phase>process-resources</phase>
> >            <goals>
> >              <goal>copy-dependencies</goal>
> >            </goals>
> >            <configuration>
> >              <outputDirectory>${applet.directory}</outputDirectory>
> >              <stripVersion>true</stripVersion>
> >            </configuration>
> >          </execution>
> >        </executions>
> >      </plugin>
> >    </plugins>
> >  </build>
> > </project>
> >
>
>

Re: creating a small non-primary war

Posted by Anders Hammar <an...@hammar.net>.
Why isn't the war the primary artifact?
I would suggest you structure this as two modules; the first creates the war
that includes the applet and the other one is the larger war.

/Anders

On Tue, Jan 11, 2011 at 21:22, Mike Calmus <mi...@calmus.org> wrote:

>  I am trying to create a non-primary war that includes an applet jar and
> its
> dependencies. This war is then merged into a larger war.
>
> When I try to do this, though I get an error from the Maven Install plugin
> indicating no primary artificat was created. The error returend is somewhat
> different depending upon the plugin versions involved.
>
> Here's what I have. Is there some better way to do this, or is this a bug
> in
> one of the plugins or both? Thanks.
>
> <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/maven-v4_0_0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>my.test.group</groupId>
>  <artifactId>mytest-applet-war</artifactId>
>  <packaging>war</packaging>
>  <version>1.0</version>
>  <name>My Test Applet War</name>
>  <properties>
>
>
> <applet.directory>${project.build.directory}/${project.build.finalName}/applet</applet.directory>
>  </properties>
>  <dependencies>
>    <dependency>
>      <groupId>my.test.group</groupId>
>      <artifactId>mytest-applet</artifactId>
>      <version>1.0</version>
>      <type>jar</type>
>      <scope>provided</scope>
>    </dependency>
>  </dependencies>
>  <build>
>    <plugins>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-war-plugin</artifactId>
>        <configuration>
>          <primaryArtifact>false</primaryArtifact>
>          <failOnMissingWebXml>false</failOnMissingWebXml>
>        </configuration>
>      </plugin>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-dependency-plugin</artifactId>
>        <executions>
>          <execution>
>            <phase>process-resources</phase>
>            <goals>
>              <goal>copy-dependencies</goal>
>            </goals>
>            <configuration>
>              <outputDirectory>${applet.directory}</outputDirectory>
>              <stripVersion>true</stripVersion>
>            </configuration>
>          </execution>
>        </executions>
>      </plugin>
>    </plugins>
>  </build>
> </project>
>