You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Kenney Westerhof <fo...@neonics.com> on 2005/07/07 07:56:36 UTC

Re: How to build the first Java Based Plugin (I can offer to document the process if it is not already documented)

On Wed, 6 Jul 2005, Ryan, Scott wrote:

Hi Scott,

First: your call to maven-archetype-plugin is incorrect, it should be:

m2 archetype:create -DarchetypeArtifactId=maven-archetype-mojo
-DgroupId=Weblogic -DartifactId=maven-weblogic-plugin


(at least, when I do it your way I get the same wrong pom, but this way it
produces the correct pom).

The main problem here seems to be that you're depending on maven-core, but
plugins should have at least have a dependency on maven-plugin-api.

What you could do is check your local repository
(~/.m2/repository/org/apache/maven/plugins/) and get a pom from one of the
plugins there to see what dependencies are used.


-- Kenney

> I have been searching the net for any suggestions on building a Java based
> plugin and have pieced together enough to be dangerous but am still hung up
> on some issues.

>
>
>
> I first tried to run the project generator
>
>
>
> maven archetype:create -Darchetype=mojo -DgroupId=Weblogic
> -DartifactId=maven-weblogic-plugin
>
>
>
> It generated a project but just a regular jar project and not a plugin
> project.  I updated the pom.xml to ready as
>
>
>
> <project>
>
>   <modelVersion>4.0.0</modelVersion>
>
>   <groupId>org.apache.maven.plugins</groupId>
>
>   <artifactId>maven-weblogic-plugin</artifactId>
>
>   <packaging>maven-plugin</packaging>
>
>   <version>1.0-SNAPSHOT</version>
>
>   <name>Maven Weblogic Plugin</name>
>
>   <url>http://maven.apache.org</url>
>
>   <dependencies>
>
>     <dependency>
>
>       <groupId>org.apache.maven</groupId>
>
>       <artifactId>maven-core</artifactId>
>
>       <version>2.0-SNAPSHOT</version>
>
>     </dependency>
>
>   </dependencies>
>
> </project>
>
>
>
> I then created my first mojo and tried to run m2 install
>
>
>
> After lots of downloading I received the following message:
>
>
>
> [INFO]
> ----------------------------------------------------------------------------
>
> [INFO] Building Maven Weblogic Plugin
>
> [INFO]
> ----------------------------------------------------------------------------
>
> [INFO] maven-plugin-plugin: resolved to version 2.0-alpha-3 from local
> repository
>
> [INFO] maven-resources-plugin: resolved to version 2.0-alpha-3 from local
> repository
>
> [INFO] maven-compiler-plugin: resolved to version 2.0-alpha-3 from local
> repository
>
> [INFO] maven-surefire-plugin: resolved to version 2.0-alpha-3 from local
> repository
>
> [INFO] maven-jar-plugin: resolved to version 2.0-alpha-3 from local
> repository
>
> [INFO] maven-install-plugin: resolved to version 2.0-alpha-3 from local
> repository
>
> [INFO] [plugin:descriptor]
>
> [INFO] [resources:resources]
>
> [INFO] maven-core: resolved to version 2.0-20050407.164450-2 from local
> repository
>
> [INFO] maven: resolved to version 2.0-20050623.042038-4 from local
> repository
>
> [INFO] maven-artifact: resolved to version 2.0-20050425.084819-4 from local
> repository
>
> [INFO] wagon-provider-api: resolved to version
> 1.0-alpha-3-20050429.051847-12 from local repositor
>
> [INFO] wagon: resolved to version 1.0-alpha-3-20050429.051847-9 from local
> repository
>
> [INFO] plexus-container-default: resolved to version
> 1.0-alpha-3-20050506.033057-12 from local rep
>
> itory
>
> [INFO] plexus-containers: resolved to version 1.0-alpha-3-20050414.062456-1
> from local repository
>
> [INFO] maven-settings: resolved to version 2.0-20050407.164450-2 from local
> repository
>
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/maven-artifact/2.0-SNAPSHOT/m
> aven-arti
>
> ct-2.0-20050401.153037-4.pom
>
> [WARNING] Unable to get resource from repository
> http://repo1.maven.org/maven2
>
> [INFO]
> ----------------------------------------------------------------------------
>
> [INFO] BUILD FAILURE
>
> [INFO]
> ----------------------------------------------------------------------------
>
> [INFO] Main Error:
>
>   Unable to read the metadata file
>
>   org.apache.maven:maven-artifact:2.0-20050401.153037-4:jar
>
>
>
> from the specified remote repositories:
>
>   http://repo1.maven.org/maven2
>
> Path to dependency:
>
>         1)
> org.apache.maven.plugins:maven-weblogic-plugin:maven-plugin:1.0-SNAPSHOT
>
>         2) org.apache.maven:maven-core:jar:2.0-SNAPSHOT
>
>         3) plexus:plexus-container-artifact:jar:1.0-alpha-2
>
>
>
>
>
>
>
> Root error:
>
>   Unable to download the artifact from any repository
>
> [INFO]
> ----------------------------------------------------------------------------
>
> [INFO] Total time: 5 seconds
>
> [INFO] Finished at: Wed Jul 06 13:36:04 MDT 2005
>
> [INFO] Final Memory: 2M/5M
>
> [INFO]
> ----------------------------------------------------------------------------
>
>
>
> I checked the repository and found the pom and jar but not in the location
> it was looking.  I tried to move them onto my local repository but still no
> luck.
>
>
>
> Is there a documented process or test plugin that shows what is supported
> with alpha 3?  If not I am more than happy to research and document and
> deliver a sample for both java and marmalade.
>
>
>
> I would appreciate any pointers to sources of information or pointers to
> help my learning curve.
>
>
>
>
>
>
>
> Scott Damon Ryan
>
> Developer
>
> (720) 514-5389
>
> Scott.Ryan@echostar.com <ma...@echostar.com>
>
>
>
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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