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 2006/03/04 15:59:20 UTC
[m2] The packaging for this project did not assign a file to the
build artifact
Hi all,
I have followed the
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
to add custom packaging and artifact handler to my plugin.
In the ArtifactHandler configuration section I have defined:
<extension>war</extension>
<type>my-type</type>
<packaging>war</packaging>
<language>my-language</language>
<addedToClasspath>false</addedToClasspath>
When binding my WAR mojo to the build lifecycle, i.e.
<package>com.acme:my-plugin:war</package>
then I get a build error with the following description:
"The packaging for this project did not assign a file to the build
artifact".
I tried to see what happens if I bind the Maven JAR mojo, i.e.
<package>org.apache.maven.plugins:maven-jar-plugin:jar</package>
and changed the ArtifactHandler configuration section to:
<extension>jar</extension>
<type>my-type</type>
<packaging>jar</packaging>
<language>my-language</language>
<addedToClasspath>false</addedToClasspath>
then I get a successful build but the extension type of the installed
artifact is not ".jar" but ".my-type". Why?!
Please help I am stuck!
In the lifecycle guide there is a line of Java code
[project.getArtifact().setFile( new File( "target/myFile-2.0.jar" ) );]
which must be executed by the packaging goal. I have built my mojos in
ANT -- how do I accomplish this with ANT code? (I tried the ANT's
<property name="project.artifact.file" value="my.war" /> but did not work)
...and TIA.
Adrian.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] The packaging for this project did not assign a file to
the build artifact
Posted by Adrian Herscu <bm...@fastmail.fm>.
SOLVED
-------
I made one mistake in the components.xml -- the packaging element should
match the role-hint element.
The ANT script task (apparently) must be used to access Maven's object
model -- I have used the following code in my.build.xml file:
<script language="beanshell"><![CDATA[
mavenProject.getArtifact().setFile( new java.io.File( myWarPath ) );
]]></script>
This of course requires maven-script-beanshell, bsf and ant-apache-bsf
dependencies.
Is there a more elegant way?
E.g. using only clean ANT syntax?
Adrian.
Adrian Herscu wrote:
> Hi all,
>
> I have followed the
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
> to add custom packaging and artifact handler to my plugin.
>
> In the ArtifactHandler configuration section I have defined:
> <extension>war</extension>
> <type>my-type</type>
> <packaging>war</packaging>
> <language>my-language</language>
> <addedToClasspath>false</addedToClasspath>
>
> When binding my WAR mojo to the build lifecycle, i.e.
>
> <package>com.acme:my-plugin:war</package>
>
> then I get a build error with the following description:
> "The packaging for this project did not assign a file to the build
> artifact".
>
> I tried to see what happens if I bind the Maven JAR mojo, i.e.
> <package>org.apache.maven.plugins:maven-jar-plugin:jar</package>
>
> and changed the ArtifactHandler configuration section to:
>
> <extension>jar</extension>
> <type>my-type</type>
> <packaging>jar</packaging>
> <language>my-language</language>
> <addedToClasspath>false</addedToClasspath>
>
>
> then I get a successful build but the extension type of the installed
> artifact is not ".jar" but ".my-type". Why?!
>
>
> Please help I am stuck!
>
> In the lifecycle guide there is a line of Java code
> [project.getArtifact().setFile( new File( "target/myFile-2.0.jar" ) );]
> which must be executed by the packaging goal. I have built my mojos in
> ANT -- how do I accomplish this with ANT code? (I tried the ANT's
> <property name="project.artifact.file" value="my.war" /> but did not work)
>
> ...and TIA.
> Adrian.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org