[ http://jira.codehaus.org/browse/MINSTALL-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_126016 ]
Michele Lorenzini commented on MINSTALL-40: ------------------------------------------- I've tried to comment the classifier in the second (jar) sample, and it installs with no problem (also without a target/classes directory). And it says: [INFO] Installing C:\Temp\MINSTALL-40-2\target\foo-jar-1.0.jar to C:\Documents and Settings\xxx\.m2\repository\foo\bar\foo-jar\1.0\foo-jar-1.0.jar If I restore the classifier, the install goal fails with this: [INFO] Installing C:\Temp\MINSTALL-40-2\target\classes to C:\Documents and Settings\xxx\.m2\repository\foo\bar\foo-jar\1.0\foo-jar-1.0.jar [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error installing artifact: File C:\Temp\MINSTALL-40-2\target\classes does not exist This trace is done in the DefaultArtifactInstaller, when the InstallMojo calls: installer.install( file, artifact, localRepository ); The DefaultArtifactInstaller tries here to copy "file" on the destination (repository) with: FileUtils.copyFile( source, destination ); thats the line that raises the Exception, if I'm right, because there is no C:\Temp\MINSTALL-40-2\target\classes directory. So the question is: why the artifact metadata, in the case of a "classified" artifact, gives "C:\Temp\MINSTALL-40-2\target\classes" as the file path, and not "C:\Temp\MINSTALL-40-2\target\foo-jar-1.0-xxx.jar" as it should be? Hope it helps > install with classifier with no target/classes fails > ---------------------------------------------------- > > Key: MINSTALL-40 > URL: http://jira.codehaus.org/browse/MINSTALL-40 > Project: Maven 2.x Install Plugin > Issue Type: Bug > Affects Versions: 2.1, 2.2 > Environment: Maven version: 2.0.5, Winx XP pro > Reporter: Michele Lorenzini > Priority: Minor > Attachments: clean-install-with-war-2.0.2.log, clean-install.log, > MINSTALL40-sample2.zip, sample-war.zip > > > The install plugin fails with the following error: > Error installing artifact: File C:\TEMP\sample-war\target\classes does not > exist > in a project where there is no class or classpath resource generation (so the > target/classes folder is not generated in the compile phase). > Suppose for example a war application with no java source code (maybe only > jar dependencies) and no classpath resource. > Installing the project as a primary artifact works fine. > Installing the project as a secondary artifact (so with "classifier" option) > with classes or resources works fine. > Installing the project as a secondary artifact without classes or resources > gives the error below. > Attached is a simple project with packaging WAR composed only by a web.xml > file. > Running "mvn install" on this project should give the error above. Commenting > the classifier tag will result in a successful install. > Also if I put a simple java file (or a resource) the compile goal will create > target/classes folder and the install works fine. > In fact I am using this kind of workaround for the moment (include a dummy > resource in the war build). > The same is with a similar jar project (although it may be less useful to > have an "empty" jar artifact). > Verified with both maven-install-plugin 2.1 and 2.2 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira