You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marc Girod <ma...@gmail.com> on 2012/07/10 11:02:42 UTC

Fail to build snapshot

This is not exactly a question, as I'll move on not wainting for an answer.
Rather a log of an unsolved issue. So, I'd be glad if somebody can explain.
Writing this down may even help me to find the explanation myself.

I decided to build some understanding of maven by debugging it with jdb.
This led me to checkout in subversion the wagon-2.2 tag, and to build it.
Now, this would not build it, but rather download the jar from our cache of
central.
So, I changed the 'version' field to 2.2.1-SNAPSHOT in the wagon-http pom
file.
I had to force 2.2 for the parent.
I attempted to build: mvn install.

The build failed, because of a surefile test for HTTP Provider.
I decided this might be caused by a proxy configuration (?) so that I
decided to skip this.
I tried next: mvn install::install

This failed for API 2.2 with the error:

Failed to execute goal
org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-cli)
on project wagon-provider-api: 
The packaging for this project did not assign a file to the build artifact

Armed with my debugger, I trace the issue down to InstallMojo:97
(maven-install-plugin-2.3.1)

                File file = artifact.getFile();

And indeed, 'dumping' the 'artifact' variable, I could check that its 'file'
field was null:

main[1] dump artifact
 artifact = {
    groupId: "org.apache.maven.wagon"
    artifactId: "wagon-provider-api"
    baseVersion: "2.2"
    type: "jar"
    classifier: null
    scope: null
    file: null
...

Now, I also checked that the jar was found in the target directory of my
build tree:

./wagon-provider-api/target/wagon-provider-api-2.2.jar

and even that setting it as value to file under the debugger was enough to
pass over the error:

main[1] set artifact.file = new
java.io.File("wagon-provider-api/target/wagon-provider-api-2.2.jar")
 artifact.file = new
java.io.File("wagon-provider-api/target/wagon-provider-api-2.2.jar") =
"wagon-provider-api/target/wagon-provider-api-2.2.jar"
main[1] dump artifact
 artifact = {
    groupId: "org.apache.maven.wagon"
    artifactId: "wagon-provider-api"
    baseVersion: "2.2"
    type: "jar"
    classifier: null
    scope: null
    file: instance of java.io.File(id=2871)
...

Now, why was it not set, I didn't understand.
Thanks
Marc

--
View this message in context: http://maven.40175.n5.nabble.com/Fail-to-build-snapshot-tp5713546.html
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: Fail to build snapshot

Posted by Marc Girod <ma...@gmail.com>.
Wayne Fay wrote
> 
> If you have problems running tests, then just skip them [1].
> 
Thanks. Skipping the tests, the build works.

Wayne Fay wrote
> 
>  As an aside, I pulled down wagon-2.2 from the tag and had no issues
> building
> it and running tests.
> 
Right. I did that too, with no change whatsoever to any pom, and it failed
in the same place.
So, my setting a proxy didn't help (I don't know in detail what this company
proxy actually does).
Again, skipping tests, the build works.

Wayne Fay wrote
> 
> Generally, you should not be invoking goals directly but rather
> depending on Maven's build lifecycle.
> 
Sure... But I want to debug (learn, understand) maven, hence to control the
steps.
I'll be happy to do that once it won't feel anymore like magic to me.
I had run the dependencies first, so I assumed the state is as expected.

Wayne Fay wrote
> 
> Read the error message again.
> "The packaging for this project did not assign a file to the build
> artifact"
> 
> That is why the file attribute was not set.
> 
But I didn't take it away, and it was set in the 2.2 tag case!?
And as <code>mvn clean package -DskipTests</code> works, producing my
snapshot jars,
'assigning a file to the build artifact' is done dynamically.
The static settings in the poms are OK...
So, there must be a earlier phase in the lifecycle which is responsible for
that?
Marc

--
View this message in context: http://maven.40175.n5.nabble.com/Fail-to-build-snapshot-tp5713546p5713800.html
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: Fail to build snapshot

Posted by Wayne Fay <wa...@gmail.com>.
> So, I changed the 'version' field to 2.2.1-SNAPSHOT in the wagon-http pom
> file.
> I had to force 2.2 for the parent.
> I attempted to build: mvn install.

This is the correct way to run "mvn install" on such a project.


> The build failed, because of a surefile test for HTTP Provider.
> I decided this might be caused by a proxy configuration (?) so that I
> decided to skip this.

If you have problems running tests, then just skip them [1]. As an
aside, I pulled down wagon-2.2 from the tag and had no issues building
it and running tests. But I have no HTTP proxy in my home Internet
connection (unless my ISP is running squid transparently). You should
be able to just:
svn checkout http://svn.apache.org/repos/asf/maven/wagon/tags/wagon-2.2 wagon
cd wagon
mvn clean package

And things should just run. Then you can go in and adjust versions to
2.2.1-SNAPSHOT and run it again.


> I tried next: mvn install::install

Generally, you should not be invoking goals directly but rather
depending on Maven's build lifecycle.


> org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-cli)
> on project wagon-provider-api:
> The packaging for this project did not assign a file to the build artifact
...
> Now, why was it not set, I didn't understand.

Read the error message again.
"The packaging for this project did not assign a file to the build artifact"

That is why the file attribute was not set.

[1] http://maven.apache.org/plugins/maven-surefire-plugin/examples/skipping-test.html

Wayne

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