You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Maven <mi...@sun.com> on 2007/04/18 17:03:55 UTC

LifecycleExecutionException: The packaging for this project did not assign a file to the build artifact

I'm trying to use the psteclipse plugin to generate my plugins.  I've read
the Eclipse Corner Article and generated an example archetype project,
my-binary-plugin.  I'm getting a LifecycleExecutionException: The packaging
for this project did not assign a file to the build artifact exception out
of the build.  Here's the POM and build output below.  Where am I supposed
to specify the missing name?  When I specify the packaging as 'jar' the
deploy works.  Also, the jar file with the correct plugin Manafest is built
in the target\pde-test directory.  Is that all I can
expect/WAD?

Best Regards,
         Michael

<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>com.mycompany.app</groupId>
  <artifactId>my-binary-plugin</artifactId>
  <packaging>binary-plugin</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>my-binary-plugin</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
    <build>
<plugins>
<plugin>
    <artifactId>maven-eclipse-plugin</artifactId>
    <configuration>
        <projectnatures>
            <projectnature>
			    org.eclipse.jdt.core.javanature
            </projectnature>
            <projectnature>
                org.eclipse.pde.PluginNature
            </projectnature>
        </projectnatures>
        <buildcommands>
            <buildcommand>
                org.eclipse.jdt.core.javabuilder
            </buildcommand>
            <buildcommand>
                org.eclipse.pde.ManifestBuilder
            </buildcommand>
            <buildcommand>
                org.eclipse.pde.SchemaBuilder
            </buildcommand>    
        </buildcommands>
        <classpathContainers>
            <classpathContainer>
                org.eclipse.pde.core.requiredPlugins
            </classpathContainer>
        </classpathContainers>
    </configuration>
</plugin>         
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-psteclipse-plugin</artifactId>
    <version>1.1.0</version>
    <extensions>true</extensions>
    <configuration>
        <logModifications>true</logModifications>
        <testFrameworkVersion>3.1.0</testFrameworkVersion>
    </configuration>
    <executions>
        <execution>
            <id>test-package</id>
            <phase>test-compile</phase>
            <goals>
                <goal>testPackage</goal>
            </goals>
        </execution>
        <execution>
            <id>update</id>
            <phase>process-resources</phase>
            <goals>
                <goal>update</goal>
            </goals>
        </execution>
        <execution>
            <id>update-site-classpath</id>
            <phase>pre-site</phase>
            <goals>
                <goal>update</goal>
            </goals>
        </execution>
    </executions>
</plugin>
        </plugins>
    </build>
    <distributionManagement>
        <repository>
            <id>my-repository</id>
            <name>My Repository</name>
            <url>file:///Documents and Settings/user/.m2/repository/</url>
        </repository>
    </distributionManagement>
    </project>

C:\Development\my-binary-plugin>mvn -e deploy
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
-------------------------------------------------------------------------
---
[INFO] Building my-binary-plugin
[INFO]    task-segment: [deploy]
[INFO]
-------------------------------------------------------------------------
---
[INFO] [psteclipse:update {execution: update}]
[INFO] Defaulting prefixes to the single prefix 'my-binary-plugin'.
[INFO] [psteclipse:testPackage {execution: test-package}]
[INFO] [site:attach-descriptor]
[INFO] [psteclipse:install]
[INFO] Installing C:\Development\my-binary-plugin\pom.xml to C:\Documents
and Se
ttings\user\.m2\repository\com\mycompany\app\my-binary-plugin\1.0-SNAPSHOT\my-
binary-plugin-1.0-SNAPSHOT.pom
[INFO] [deploy:deploy]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] The packaging for this project did not assign a file to the build
artifac
t
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The packaging for
this p
roject did not assign a file to the build artifact
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:564)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: The packaging for
thi
s project did not assign a file to the build artifact
        at
org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:130
)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
        ... 16 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Apr 18 08:53:44 MDT 2007
[INFO] Final Memory: 9M/17M
[INFO]
------------------------------------------------------------------------

-- 
View this message in context: http://www.nabble.com/LifecycleExecutionException%3A-The-packaging-for-this-project-did-not-assign-a-file-to-the-build-artifact-tf3601245s177.html#a10059514
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: LifecycleExecutionException: The packaging for this project did not assign a file to the build artifact

Posted by "T.Reichert" <ti...@credit-suisse.com>.
I've changed the AbstractPluginPackagingMojo.java to accept 'binary-plugin':

<code>
...
if ((packaging.equals("pom")) /*|| (packaging.equals("binary-plugin"))*/) {
...
</code>

and changed the package and install phase in the components.xml:

<package>
    org.apache.maven.plugins:maven-site-plugin:attach-descriptor
</package>
<install>
    org.apache.maven.plugins:maven-psteclipse-plugin:install
</install>

it works (for me)B-)

Sumit Gupta wrote:
> 
> I'd like to preface my answer below with the small fact that we don't
> actually deploy our eclipse plugins in-house, and hence we had not
> encountered this issue at the time of writing the article. We have build
> machines that run Continuum and locally we all simply do "mvn clean
> install" on all our projects. We don't use deployment as we need to create
> all sorts of assemblies with our plugins so we orchestrate the process
> slightly differently. 
> 
> That being said, this is truly an issue with maven's deploy plugin. There
> is a hard-coded line in their Mojo, that checks to see if the packaging
> type of the project is "pom". If it is, the Mojo will deploy the artifact
> one way, and for anything else it expects a file (jar, war, etc.)
> associated with what it is deploying. 
> 
> A binary-plugin is really a kind-of "pom" packaging, in that it really has
> no code and thus no artifact file associated with it. This is also how it
> is defined in the components.xml file by giving it an extension of "pom".
> There are few ways to work around this if you really need to deploy and
> not install. You could modify the deploy mojo so that it understands a
> binary-plugin and then include your modified Mojo in the lifecycle defined
> for a binary-plugin in components.xml. We will also be revisiting our code
> now that we have given it to codehaus.org (under the m2eclipse project)
> and we will be sure to fix this issue in the near term. 
> 
> 
> Michael Maven wrote:
>> 
>> I'm trying to use the psteclipse plugin to generate my plugins.  I've
>> read the Eclipse Corner Article and generated an example archetype
>> project, my-binary-plugin.  I'm getting a LifecycleExecutionException:
>> The packaging for this project did not assign a file to the build
>> artifact exception out of the build.  Here's the POM and build output
>> below.  Where am I supposed to specify the missing name?  When I specify
>> the packaging as 'jar' the deploy works.  Also, the jar file with the
>> correct plugin Manafest is built in the target\pde-test directory.  Is
>> that all I can
>> expect/WAD?
>> 
>> Best Regards,
>>          Michael
>> 
>> C:\Development\my-binary-plugin>mvn -e deploy
>> + Error stacktraces are turned on.
>> [INFO] Scanning for projects...
>> [INFO]
>> -------------------------------------------------------------------------
>> ---
>> [INFO] Building my-binary-plugin
>> [INFO]    task-segment: [deploy]
>> [INFO]
>> -------------------------------------------------------------------------
>> ---
>> [INFO] [psteclipse:update {execution: update}]
>> [INFO] Defaulting prefixes to the single prefix 'my-binary-plugin'.
>> [INFO] [psteclipse:testPackage {execution: test-package}]
>> [INFO] [site:attach-descriptor]
>> [INFO] [psteclipse:install]
>> [INFO] Installing C:\Development\my-binary-plugin\pom.xml to C:\Documents
>> and Se
>> ttings\user\.m2\repository\com\mycompany\app\my-binary-plugin\1.0-SNAPSHOT\my-
>> binary-plugin-1.0-SNAPSHOT.pom
>> [INFO] [deploy:deploy]
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] The packaging for this project did not assign a file to the build
>> artifac
>> t
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: The packaging for
>> this p
>> roject did not assign a file to the build artifact
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> ultLifecycleExecutor.java:564)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
>> fecycle(DefaultLifecycleExecutor.java:480)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
>> ltLifecycleExecutor.java:459)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
>> dleFailures(DefaultLifecycleExecutor.java:311)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
>> ts(DefaultLifecycleExecutor.java:278)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
>> fecycleExecutor.java:143)
>>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>         at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>         at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> 
>>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: org.apache.maven.plugin.MojoExecutionException: The packaging
>> for thi
>> s project did not assign a file to the build artifact
>>         at
>> org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:130
>> )
>>         at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
>> nManager.java:443)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> ultLifecycleExecutor.java:539)
>>         ... 16 more
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 3 seconds
>> [INFO] Finished at: Wed Apr 18 08:53:44 MDT 2007
>> [INFO] Final Memory: 9M/17M
>> [INFO]
>> ------------------------------------------------------------------------
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/LifecycleExecutionException%3A-The-packaging-for-this-project-did-not-assign-a-file-to-the-build-artifact-tf3601245s177.html#a12499989
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: LifecycleExecutionException: The packaging for this project did not assign a file to the build artifact

Posted by Sumit Gupta <g....@gmail.com>.
I'd like to preface my answer below with the small fact that we don't
actually deploy our eclipse plugins in-house, and hence we had not
encountered this issue at the time of writing the article. We have build
machines that run Continuum and locally we all simply do "mvn clean install"
on all our projects. We don't use deployment as we need to create all sorts
of assemblies with our plugins so we orchestrate the process slightly
differently. 

That being said, this is truly an issue with maven's deploy plugin. There is
a hard-coded line in their Mojo, that checks to see if the packaging type of
the project is "pom". If it is, the Mojo will deploy the artifact one way,
and for anything else it expects a file (jar, war, etc.) associated with
what it is deploying. 

A binary-plugin is really a kind-of "pom" packaging, in that it really has
no code and thus no artifact file associated with it. This is also how it is
defined in the components.xml file by giving it an extension of "pom". There
are few ways to work around this if you really need to deploy and not
install. You could modify the deploy mojo so that it understands a
binary-plugin and then include your modified Mojo in the lifecycle defined
for a binary-plugin in components.xml. We will also be revisiting our code
now that we have given it to codehaus.org (under the m2eclipse project) and
we will be sure to fix this issue in the near term. 


Michael Maven wrote:
> 
> I'm trying to use the psteclipse plugin to generate my plugins.  I've read
> the Eclipse Corner Article and generated an example archetype project,
> my-binary-plugin.  I'm getting a LifecycleExecutionException: The
> packaging for this project did not assign a file to the build artifact
> exception out of the build.  Here's the POM and build output below.  Where
> am I supposed to specify the missing name?  When I specify the packaging
> as 'jar' the deploy works.  Also, the jar file with the correct plugin
> Manafest is built in the target\pde-test directory.  Is that all I can
> expect/WAD?
> 
> Best Regards,
>          Michael
> 
> C:\Development\my-binary-plugin>mvn -e deploy
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Building my-binary-plugin
> [INFO]    task-segment: [deploy]
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] [psteclipse:update {execution: update}]
> [INFO] Defaulting prefixes to the single prefix 'my-binary-plugin'.
> [INFO] [psteclipse:testPackage {execution: test-package}]
> [INFO] [site:attach-descriptor]
> [INFO] [psteclipse:install]
> [INFO] Installing C:\Development\my-binary-plugin\pom.xml to C:\Documents
> and Se
> ttings\user\.m2\repository\com\mycompany\app\my-binary-plugin\1.0-SNAPSHOT\my-
> binary-plugin-1.0-SNAPSHOT.pom
> [INFO] [deploy:deploy]
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] The packaging for this project did not assign a file to the build
> artifac
> t
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: The packaging for
> this p
> roject did not assign a file to the build artifact
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:564)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:480)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:459)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:311)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:278)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:143)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> 
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: The packaging
> for thi
> s project did not assign a file to the build artifact
>         at
> org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:130
> )
>         at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:443)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:539)
>         ... 16 more
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Wed Apr 18 08:53:44 MDT 2007
> [INFO] Final Memory: 9M/17M
> [INFO]
> ------------------------------------------------------------------------
> 
> 

-- 
View this message in context: http://www.nabble.com/LifecycleExecutionException%3A-The-packaging-for-this-project-did-not-assign-a-file-to-the-build-artifact-tf3601245s177.html#a10149566
Sent from the Maven - Users mailing list archive at Nabble.com.


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