You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adrian Herscu <bm...@fastmail.fm> on 2007/10/25 16:12:15 UTC

[m2] how to make my custom packaging recognized by the eclipse plugin?

Hi all,

I am using Maven 2 to build projects based on my own framework. Because 
the framework requires different tools and dependency resolving 
mechanism, I had to create a dedicated lifecycle.

Now I am thinking about some way to integrate the build of my framework 
with the build of a Java-based Web application.

The first thing I have tried was to generate the Eclipse project 
descriptors and noticed that the .classpath file is not generated. There 
was a similar issue with the PDE projects which are packaged as ZIP-s (I 
found that this has been fixed in MECLIPSE-279).

I believe that if I will add all the WAR's lifecycle goals to my custom 
lifecycle then the build artifact created will be indistinguishable from 
that created by the WAR packaging. Is it true?

Is there any way to make the Eclipse plugin "believe" that some custom 
packaging type is a "Java" type?

Thanks,
Adrian.


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


Re: [m2] how to make my custom packaging recognized by the eclipse plugin?

Posted by Stuart McCulloch <st...@jayway.net>.
On 25/10/2007, Adrian Herscu <bm...@fastmail.fm> wrote:
>
> Hi all,
>
> I am using Maven 2 to build projects based on my own framework. Because
> the framework requires different tools and dependency resolving
> mechanism, I had to create a dedicated lifecycle.
>
> Now I am thinking about some way to integrate the build of my framework
> with the build of a Java-based Web application.
>
> The first thing I have tried was to generate the Eclipse project
> descriptors and noticed that the .classpath file is not generated. There
> was a similar issue with the PDE projects which are packaged as ZIP-s (I
> found that this has been fixed in MECLIPSE-279).
>
> I believe that if I will add all the WAR's lifecycle goals to my custom
> lifecycle then the build artifact created will be indistinguishable from
> that created by the WAR packaging. Is it true?
>
> Is there any way to make the Eclipse plugin "believe" that some custom
> packaging type is a "Java" type?


check the Eclipse plugin sources, for example in 2.4 it has:

        // ear projects don't contain java sources
        // pde projects are always java projects
        isJavaProject = pde
            || ( Constants.LANGUAGE_JAVA.equals( artifactHandler.getLanguage()
) && !Constants.PROJECT_PACKAGING_EAR
                .equals( packaging ) );

so afaik you just need to set the language to Java in your component:

    <component>
      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
      <!- ... snip ... -->
      <configuration>
        <!- ... snip ... -->
        <language>java</language>
        <!- ... snip ... -->
      </configuration>
    </component>

in your "src/main/resources/META-INF/plexus/components.xml" file

( when in doubt, check the source! )

Thanks,
> Adrian.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> --
Cheers, Stuart