FileNotFoundException when packaging WAR using project dependency

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FileNotFoundException when packaging WAR using project dependency

Daniel Kröger-2
Hi,

I started to use m2eclipse (0.9.5) for a Wicket project which references
another Maven-based project in my Eclipse workspace through the
corresponding dependency in its pom.xml. I'm using Windows XP, Java 6
and Eclipse 3.4.

The workspace resolution does work and the referenced project is
correctly displayed under the Maven Dependencies classpath container.

However when packaging the Wicket project as WAR through a Maven Build
Run Configuration (the checkbox "Resolve workspace artifacts" is checked
there) a FileNotFoundException is thrown while processing this
dependency. I attached the complete stacktrace as textfile to this message.

Is this a known problem or did i just miss something? Thanks in advance
for your replies.

Regards,
Daniel

[DEBUG] Processing: PdfProcessor-1.0-SNAPSHOT.jar
[DEBUG] disposing managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-compiler-plugin:2.0.2@48/thread:main
[DEBUG] dissociating all components from managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-compiler-plugin:2.0.2@48/thread:main
[DEBUG] disposing managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-surefire-plugin:2.3@48/thread:main
[DEBUG] dissociating all components from managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-surefire-plugin:2.3@48/thread:main
[DEBUG] disposing managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-clean-plugin:2.2@48/thread:main
[DEBUG] dissociating all components from managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-clean-plugin:2.2@48/thread:main
[DEBUG] disposing managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1@48/thread:main
[DEBUG] dissociating all components from managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1@48/thread:main
[DEBUG] disposing managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-resources-plugin:2.2@48/thread:main
[DEBUG] dissociating all components from managed ClassRealm with id: /plugins/org.apache.maven.plugins:maven-resources-plugin:2.2@48/thread:main
[ERROR]

The following mojo encountered an error while executing:
Group-Id: org.apache.maven.plugins
Artifact-Id: maven-war-plugin
Version: 2.1-alpha-1
Mojo: war
brought in via: packaging: war

While building project:
Group-Id: net.disy
Artifact-Id: EnergyPortal
Version: 1.0
From file: C:\Develop\eclipse\workspaces\ep\EnergyPortal\pom.xml
Reason: Failed to copy file for artifact[net.disy:PdfProcessor:jar:1.0-SNAPSHOT:compile]

java.io.FileNotFoundException: C:\Develop\eclipse\workspaces\ep\PdfProcessor\target\classes (Zugriff verweigert)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:929)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:304)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask$1.registered(AbstractWarPackagingTask.java:145)
        at org.apache.maven.plugin.war.util.WebappStructure.registerFile(WebappStructure.java:113)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:140)
        at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performPackaging(ArtifactsPackagingTask.java:76)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleArtifacts(WarProjectPackagingTask.java:151)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:72)
        at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:364)
        at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:317)
        at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:166)
        at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:130)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
        at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
        at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:52)



Error stacktrace:
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1:war': Mojo execution failed.
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:505)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
        at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
        at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:52)
Caused by: org.apache.maven.plugin.PluginExecutionException: Mojo execution failed.
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:601)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
        ... 12 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to copy file for artifact[net.disy:PdfProcessor:jar:1.0-SNAPSHOT:compile]
        at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performPackaging(ArtifactsPackagingTask.java:99)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleArtifacts(WarProjectPackagingTask.java:151)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:72)
        at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:364)
        at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:317)
        at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:166)
        at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:130)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
        ... 13 more
Caused by: java.io.FileNotFoundException: C:\Develop\eclipse\workspaces\ep\PdfProcessor\target\classes (Zugriff verweigert)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:929)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:304)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask$1.registered(AbstractWarPackagingTask.java:145)
        at org.apache.maven.plugin.war.util.WebappStructure.registerFile(WebappStructure.java:113)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:140)
        at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performPackaging(ArtifactsPackagingTask.java:76)
        ... 20 more


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

Re: FileNotFoundException when packaging WAR using project dependency

Igor Fedorenko-3
 From the looks of it, you're hitting limitations of workspace artifact
resolution, i.e. even though maven correctly resolves project dependency
into target\classes folder, maven-war-plugin expects dependency to be a
file and fails. If both the war and the dependency project have the same
parent, you may have better luck running "maven install" goal on the
parent project. Or you can install dependency manually and package the
war project with workspace dependency resolution disabled (not pretty,
but should work).

Also, have you considered using wtp and m2e/wtp integration? You should
be able to run your projects directly from workspace, if the projects do
not rely on war overlays/warpath, at least.


Daniel Kröger wrote:

> Hi,
>
> I started to use m2eclipse (0.9.5) for a Wicket project which references
> another Maven-based project in my Eclipse workspace through the
> corresponding dependency in its pom.xml. I'm using Windows XP, Java 6
> and Eclipse 3.4.
>
> The workspace resolution does work and the referenced project is
> correctly displayed under the Maven Dependencies classpath container.
>
> However when packaging the Wicket project as WAR through a Maven Build
> Run Configuration (the checkbox "Resolve workspace artifacts" is checked
> there) a FileNotFoundException is thrown while processing this
> dependency. I attached the complete stacktrace as textfile to this message.
>
> Is this a known problem or did i just miss something? Thanks in advance
> for your replies.
>
> Regards,
> Daniel


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: FileNotFoundException when packaging WAR using project dependency

Daniel Kröger-2
Thanks for your reply, Igor!

I hoped that there was some m2eclipse magic which automatically
generates a jar and resolves that insted of target\classes or something
like that. :)


Igor Fedorenko schrieb:

>  From the looks of it, you're hitting limitations of workspace artifact
> resolution, i.e. even though maven correctly resolves project dependency
> into target\classes folder, maven-war-plugin expects dependency to be a
> file and fails. If both the war and the dependency project have the same
> parent, you may have better luck running "maven install" goal on the
> parent project. Or you can install dependency manually and package the
> war project with workspace dependency resolution disabled (not pretty,
> but should work).
>
> Also, have you considered using wtp and m2e/wtp integration? You should
> be able to run your projects directly from workspace, if the projects do
> not rely on war overlays/warpath, at least.
>
>
> Daniel Kröger wrote:
>> Hi,
>>
>> I started to use m2eclipse (0.9.5) for a Wicket project which
>> references another Maven-based project in my Eclipse workspace through
>> the corresponding dependency in its pom.xml. I'm using Windows XP,
>> Java 6 and Eclipse 3.4.
>>
>> The workspace resolution does work and the referenced project is
>> correctly displayed under the Maven Dependencies classpath container.
>>
>> However when packaging the Wicket project as WAR through a Maven Build
>> Run Configuration (the checkbox "Resolve workspace artifacts" is
>> checked there) a FileNotFoundException is thrown while processing this
>> dependency. I attached the complete stacktrace as textfile to this
>> message.
>>
>> Is this a known problem or did i just miss something? Thanks in
>> advance for your replies.
>>
>> Regards,
>> Daniel
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

--
disy Informationssysteme GmbH
Daniel Kröger, B.Sc., Softwareentwickler
Tel: +49 721 1 600 6 603, Fax: -005, E-Mail: [hidden email]

Firmensitz: Erbprinzenstr. 4-12, 76133 Karlsruhe
Registergericht: Amtsgericht Mannheim, HRB 107964
Geschäftsführer: Sven Behrens, Dr. Ralf Nikolai, Claus Hofmann

http://www.disy.net/cadenza - Berichte und Auswertungen mit Raumbezug
http://www.disy.net/e-meetings - Telefon- und Web-Konferenzen

--------------------------------
dialog . daten . dimensionen
--------------------------------

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email