maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "János Jarecsni" <janos.jarec...@gmail.com>
Subject writing maven plugins
Date Mon, 25 Jun 2007 14:10:54 GMT
Hi,

I'm new to maven and to this list so Hi everybody :) Here's my problem: I'd
have to write a maven plugin, which would extend the normal behaviour of the
Jar Archiver. What I need is that the target jar also includes some of the
declared dependencies. I'm stuck for two reasons:

1. Upon setting up the basic mojo project, I can't proceed as the install
goal fails:

[INFO] Scanning for projects...
[INFO]
----------------------------------------------------------------------------
[INFO] Building Maven Sample Plugin
[INFO]    task-segment: [install]
[INFO]
----------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-plugin-plugin' does not
exist or no valid version could be found
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Mon Jun 25 16:03:06 CEST 2007
[INFO] Final Memory: 1M/2M
[INFO]
------------------------------------------------------------------------

Here's the pom:
<project 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' xmlns='
http://maven.apache.org/POM/4.0.0'>
  <modelVersion>4.0.0</modelVersion>
  <groupId>mygroup</groupId>
  <artifactId>maven-simple-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>Maven Sample Plugin</name>
  <version>1.0</version>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>2.0</version>
    </dependency>
  </dependencies>
</project>

Secondly, I'm unsure: I think I will have to create a new packaging, and
delegate some work to the JAR packager? Something like chain of
responsibilities is not possible with Mojos in this case, I fear. Am I
right?

Thanks in advance,
Janos

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message