You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by RobJac <ro...@caritor.com> on 2006/04/27 10:12:12 UTC

issue with mvn clean install

I have a maven project folder structure as shown below

Main
  pom.xml
  
  Project A
  	pom.xml
  	
  Project B
    pom.xml
    
  Project C
    pom.xml
    
  Project D
    pom.xml    

I am trying to build and install multiple projects. So in the Main folder if
i run mvn clean install. Its trying to delete the folder Project A and then
trying to install Project A and fails saying that the Project A pom xml is
not found. I dont really understand what is the point in doing mvn clean
install instead mvn install works fine for me.

Pls see below the exception i get
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Unnamed - Main:Main:pom:1.0
[INFO]   Maven Quick Start Archetype
[INFO]   Maven Quick Start Archetype
[INFO]   Maven Quick Start Archetype
[INFO]   Maven Quick Start Archetype
[INFO]
-------------------------------------------------------------------------
---
[INFO] Building Unnamed - Main:Main:pom:1.0
[INFO]    task-segment: [clean, install]
[INFO]
-------------------------------------------------------------------------
---
[INFO] [clean:clean]
[INFO] Deleting directory C:\Main\target
[INFO] Deleting directory C:\Main\target\classes
[INFO] Deleting directory C:\Main\target\test-classes
[INFO] [install:install]
[INFO] Installing C:\Main\pom.xml to C:\Maven\remote\repository\Main\Main
\1.0\Main-1.0.pom
[INFO]
-------------------------------------------------------------------------
---
[INFO] Building Maven Quick Start Archetype
[INFO]    task-segment: [clean, install]
[INFO]
-------------------------------------------------------------------------
---
[INFO] [clean:clean]
[INFO] Deleting directory C:\Main\Project A
[INFO] Deleting directory C:\Main\Project A\classes
[INFO] Deleting directory C:\Main\Project A\test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: C:\Main\Project A\Project A.jar
[INFO] [install:install]
[INFO] Installing C:\Main\Project A\Project A.jar to C:\Maven\r
emote\repository\Project A\Project A\1.0\Project A-1.0.jar
[INFO]
-------------------------------------------------------------------------
---
[ERROR] BUILD ERROR
[INFO]
-------------------------------------------------------------------------
---
[INFO] Error installing artifact's metadata: Error installing metadata:
Error re
writing POM

C:\Main\Project A\pom.xml (The system cannot find the file specified)
[INFO]
-------------------------------------------------------------------------
---
[INFO] For more information, run Maven with the -e switch
[INFO]
-------------------------------------------------------------------------
---
[INFO] Total time: 4 seconds
[INFO] Finished at: Thu Apr 27 08:53:39 BST 2006
[INFO] Final Memory: 4M/8M
[INFO]
-------------------------------------------------------------------------
---

This is how the pom xml of the Main folder looks like

<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>Main</groupId>
  <artifactId>Main</artifactId>
  <packaging>pom</packaging>
  <version>1.0</version>
  <modules>
	<module>Project A</module>
	<module>Project B<</module>	
	<module>Project C<</module>
	<module>Project D<</module>
  </modules>
</project>

Am I missing something here?
--
View this message in context: http://www.nabble.com/issue-with-mvn-clean-install-t1516559.html#a4116302
Sent from the Maven - Users forum at Nabble.com.


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


Re: issue with mvn clean install

Posted by Simon Kitching <sk...@apache.org>.
This is very odd. Normally, "mvn clean" would simply run "mvn clean" in
each of the defined modules. That's certainly what it does for me.

The child modules would then respond by (normally) deleting the "target"
directory, to get rid of any old .class directories etc.

What does your project A's pom.xml look like?

Regards,

Simon


On Thu, 2006-04-27 at 01:12 -0700, RobJac wrote:
> I have a maven project folder structure as shown below
> 
> Main
>   pom.xml
>   
>   Project A
>   	pom.xml
>   	
>   Project B
>     pom.xml
>     
>   Project C
>     pom.xml
>     
>   Project D
>     pom.xml    
> 
> I am trying to build and install multiple projects. So in the Main folder if
> i run mvn clean install. Its trying to delete the folder Project A and then
> trying to install Project A and fails saying that the Project A pom xml is
> not found. I dont really understand what is the point in doing mvn clean
> install instead mvn install works fine for me.
> 
> Pls see below the exception i get
> [INFO] Scanning for projects...
> [INFO] Reactor build order:
> [INFO]   Unnamed - Main:Main:pom:1.0
> [INFO]   Maven Quick Start Archetype
> [INFO]   Maven Quick Start Archetype
> [INFO]   Maven Quick Start Archetype
> [INFO]   Maven Quick Start Archetype
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Building Unnamed - Main:Main:pom:1.0
> [INFO]    task-segment: [clean, install]
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] [clean:clean]
> [INFO] Deleting directory C:\Main\target
> [INFO] Deleting directory C:\Main\target\classes
> [INFO] Deleting directory C:\Main\target\test-classes
> [INFO] [install:install]
> [INFO] Installing C:\Main\pom.xml to C:\Maven\remote\repository\Main\Main
> \1.0\Main-1.0.pom
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Building Maven Quick Start Archetype
> [INFO]    task-segment: [clean, install]
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] [clean:clean]
> [INFO] Deleting directory C:\Main\Project A
> [INFO] Deleting directory C:\Main\Project A\classes
> [INFO] Deleting directory C:\Main\Project A\test-classes
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] No sources to compile
> [INFO] [surefire:test]
> [INFO] No tests to run.
> [INFO] [jar:jar]
> [WARNING] JAR will be empty - no content was marked for inclusion!
> [INFO] Building jar: C:\Main\Project A\Project A.jar
> [INFO] [install:install]
> [INFO] Installing C:\Main\Project A\Project A.jar to C:\Maven\r
> emote\repository\Project A\Project A\1.0\Project A-1.0.jar
> [INFO]
> -------------------------------------------------------------------------
> ---
> [ERROR] BUILD ERROR
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Error installing artifact's metadata: Error installing metadata:
> Error re
> writing POM
> 
> C:\Main\Project A\pom.xml (The system cannot find the file specified)
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Total time: 4 seconds
> [INFO] Finished at: Thu Apr 27 08:53:39 BST 2006
> [INFO] Final Memory: 4M/8M
> [INFO]
> -------------------------------------------------------------------------
> ---
> 
> This is how the pom xml of the Main folder looks like
> 
> <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>Main</groupId>
>   <artifactId>Main</artifactId>
>   <packaging>pom</packaging>
>   <version>1.0</version>
>   <modules>
> 	<module>Project A</module>
> 	<module>Project B<</module>	
> 	<module>Project C<</module>
> 	<module>Project D<</module>
>   </modules>
> </project>
> 
> Am I missing something here?
> --
> View this message in context: http://www.nabble.com/issue-with-mvn-clean-install-t1516559.html#a4116302
> Sent from the Maven - Users forum at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Re: issue with mvn clean install

Posted by Simon Kitching <sk...@apache.org>.
Yep, that looks like the cause to me. if ${basedir} is mapping to ".",
then when maven tries to delete the "output directory" it would end up
deleting the "Project A" dir, just as shown.

Try removing the outputDirectory elemnt from the pom (so it defaults to
its normal value).

Cheers,

Simon

On Thu, 2006-04-27 at 11:12 +0200, Tom Joad wrote:
> Why do you have to set explicitly ${basedir} On project A pom.xml for
> different location.
> Try to give relative path so without ${basedir}
> Tom.
> 
> 2006/4/27, RobJac <ro...@caritor.com>:
> >
> > Yes I do. This is how my Project A pom.xml looks like
> >
> > <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>Project A</groupId>
> >   <artifactId>Project A</artifactId>
> >   <packaging>jar</packaging>
> >   <version>1.0</version>
> >   <name>Maven Quick Start Archetype</name>
> >   <parent>
> >     <groupId>Main</groupId>
> >     <artifactId>Main</artifactId>
> >     <version>1.0</version>
> >   </parent>
> >   <dependencies>
> >     <dependency>
> >       <groupId>antlr</groupId>
> >       <artifactId>antlr</artifactId>
> >       <version>2.7.5H3</version>
> >       <scope>provided</scope>
> >     </dependency>
> >
> >   </dependencies>
> >   <build>
> >     <directory>${basedir}</directory>
> >     <outputDirectory>classes</outputDirectory>
> >     <finalName>${project.artifactId}</finalName>
> >     <testOutputDirectory>test-classes</testOutputDirectory>
> >     <sourceDirectory>src</sourceDirectory>
> >     <testSourceDirectory>test</testSourceDirectory>
> >     <resources>
> >       <resource>
> >         <directory>${basedir}/resources</directory>
> >       </resource>
> >         <resource>
> >             <directory>src</directory>
> >             <filtering>false</filtering>
> >             <excludes>
> >               <exclude>**/*.java</exclude>
> >             </excludes>
> >           </resource>
> >
> >     </resources>
> >     <testResources>
> >       <testResource>
> >         <directory>test</directory>
> >       </testResource>
> >     </testResources>
> >         <plugins>
> >             <plugin>
> >               <groupId>org.apache.maven.plugins</groupId>
> >               <artifactId>maven-compiler-plugin</artifactId>
> >                 <configuration>
> >                   <source>1.5</source>
> >                   <target>1.5</target>
> >                 </configuration>
> >                </plugin>
> >         </plugins>
> >   </build>
> >
> >   <reporting>
> >     <outputDirectory>target/site</outputDirectory>
> >   </reporting>
> > </project>
> > --
> > View this message in context: http://www.nabble.com/issue-with-mvn-clean-install-t1516559.html#a4117154
> > Sent from the Maven - Users forum at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Re: issue with mvn clean install

Posted by Tom Joad <tj...@gmail.com>.
Why do you have to set explicitly ${basedir} On project A pom.xml for
different location.
Try to give relative path so without ${basedir}
Tom.

2006/4/27, RobJac <ro...@caritor.com>:
>
> Yes I do. This is how my Project A pom.xml looks like
>
> <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>Project A</groupId>
>   <artifactId>Project A</artifactId>
>   <packaging>jar</packaging>
>   <version>1.0</version>
>   <name>Maven Quick Start Archetype</name>
>   <parent>
>     <groupId>Main</groupId>
>     <artifactId>Main</artifactId>
>     <version>1.0</version>
>   </parent>
>   <dependencies>
>     <dependency>
>       <groupId>antlr</groupId>
>       <artifactId>antlr</artifactId>
>       <version>2.7.5H3</version>
>       <scope>provided</scope>
>     </dependency>
>
>   </dependencies>
>   <build>
>     <directory>${basedir}</directory>
>     <outputDirectory>classes</outputDirectory>
>     <finalName>${project.artifactId}</finalName>
>     <testOutputDirectory>test-classes</testOutputDirectory>
>     <sourceDirectory>src</sourceDirectory>
>     <testSourceDirectory>test</testSourceDirectory>
>     <resources>
>       <resource>
>         <directory>${basedir}/resources</directory>
>       </resource>
>         <resource>
>             <directory>src</directory>
>             <filtering>false</filtering>
>             <excludes>
>               <exclude>**/*.java</exclude>
>             </excludes>
>           </resource>
>
>     </resources>
>     <testResources>
>       <testResource>
>         <directory>test</directory>
>       </testResource>
>     </testResources>
>         <plugins>
>             <plugin>
>               <groupId>org.apache.maven.plugins</groupId>
>               <artifactId>maven-compiler-plugin</artifactId>
>                 <configuration>
>                   <source>1.5</source>
>                   <target>1.5</target>
>                 </configuration>
>                </plugin>
>         </plugins>
>   </build>
>
>   <reporting>
>     <outputDirectory>target/site</outputDirectory>
>   </reporting>
> </project>
> --
> View this message in context: http://www.nabble.com/issue-with-mvn-clean-install-t1516559.html#a4117154
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: issue with mvn clean install

Posted by RobJac <ro...@caritor.com>.
Yes I do. This is how my Project A pom.xml looks like

<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>Project A</groupId>
  <artifactId>Project A</artifactId>
  <packaging>jar</packaging>
  <version>1.0</version>
  <name>Maven Quick Start Archetype</name>
  <parent>
    <groupId>Main</groupId>
    <artifactId>Main</artifactId>
    <version>1.0</version>
  </parent>
  <dependencies>
    <dependency>
      <groupId>antlr</groupId>
      <artifactId>antlr</artifactId>
      <version>2.7.5H3</version>
      <scope>provided</scope>
    </dependency>    
    
  </dependencies>
  <build>
    <directory>${basedir}</directory>
    <outputDirectory>classes</outputDirectory>
    <finalName>${project.artifactId}</finalName>
    <testOutputDirectory>test-classes</testOutputDirectory>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <resources>
      <resource>
        <directory>${basedir}/resources</directory>
      </resource>
	<resource> 
	    <directory>src</directory> 
	    <filtering>false</filtering> 
	    <excludes> 
	      <exclude>**/*.java</exclude> 
	    </excludes> 
	  </resource> 
      
    </resources>
    <testResources>
      <testResource>
        <directory>test</directory>
      </testResource>
    </testResources>
	<plugins>
	    <plugin>
	      <groupId>org.apache.maven.plugins</groupId>
	      <artifactId>maven-compiler-plugin</artifactId>
		<configuration>
		  <source>1.5</source>
		  <target>1.5</target>
		</configuration>
	       </plugin>        
	</plugins>      
  </build>

  <reporting>
    <outputDirectory>target/site</outputDirectory>
  </reporting>
</project>
--
View this message in context: http://www.nabble.com/issue-with-mvn-clean-install-t1516559.html#a4117154
Sent from the Maven - Users forum at Nabble.com.


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


Re: issue with mvn clean install

Posted by Tom Joad <tj...@gmail.com>.
Do you have
<parent>
<groupId>Main</groupId>
  <artifactId>Main</artifactId>
  <packaging>pom</packaging>
  <version>1.0</version>
</parent>
for all modules?
Tom.

2006/4/27, RobJac <ro...@caritor.com>:
>
> I have a maven project folder structure as shown below
>
> Main
>   pom.xml
>
>   Project A
>         pom.xml
>
>   Project B
>     pom.xml
>
>   Project C
>     pom.xml
>
>   Project D
>     pom.xml
>
> I am trying to build and install multiple projects. So in the Main folder if
> i run mvn clean install. Its trying to delete the folder Project A and then
> trying to install Project A and fails saying that the Project A pom xml is
> not found. I dont really understand what is the point in doing mvn clean
> install instead mvn install works fine for me.
>
> Pls see below the exception i get
> [INFO] Scanning for projects...
> [INFO] Reactor build order:
> [INFO]   Unnamed - Main:Main:pom:1.0
> [INFO]   Maven Quick Start Archetype
> [INFO]   Maven Quick Start Archetype
> [INFO]   Maven Quick Start Archetype
> [INFO]   Maven Quick Start Archetype
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Building Unnamed - Main:Main:pom:1.0
> [INFO]    task-segment: [clean, install]
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] [clean:clean]
> [INFO] Deleting directory C:\Main\target
> [INFO] Deleting directory C:\Main\target\classes
> [INFO] Deleting directory C:\Main\target\test-classes
> [INFO] [install:install]
> [INFO] Installing C:\Main\pom.xml to C:\Maven\remote\repository\Main\Main
> \1.0\Main-1.0.pom
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Building Maven Quick Start Archetype
> [INFO]    task-segment: [clean, install]
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] [clean:clean]
> [INFO] Deleting directory C:\Main\Project A
> [INFO] Deleting directory C:\Main\Project A\classes
> [INFO] Deleting directory C:\Main\Project A\test-classes
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] No sources to compile
> [INFO] [surefire:test]
> [INFO] No tests to run.
> [INFO] [jar:jar]
> [WARNING] JAR will be empty - no content was marked for inclusion!
> [INFO] Building jar: C:\Main\Project A\Project A.jar
> [INFO] [install:install]
> [INFO] Installing C:\Main\Project A\Project A.jar to C:\Maven\r
> emote\repository\Project A\Project A\1.0\Project A-1.0.jar
> [INFO]
> -------------------------------------------------------------------------
> ---
> [ERROR] BUILD ERROR
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Error installing artifact's metadata: Error installing metadata:
> Error re
> writing POM
>
> C:\Main\Project A\pom.xml (The system cannot find the file specified)
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> -------------------------------------------------------------------------
> ---
> [INFO] Total time: 4 seconds
> [INFO] Finished at: Thu Apr 27 08:53:39 BST 2006
> [INFO] Final Memory: 4M/8M
> [INFO]
> -------------------------------------------------------------------------
> ---
>
> This is how the pom xml of the Main folder looks like
>
> <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>Main</groupId>
>   <artifactId>Main</artifactId>
>   <packaging>pom</packaging>
>   <version>1.0</version>
>   <modules>
>         <module>Project A</module>
>         <module>Project B<</module>
>         <module>Project C<</module>
>         <module>Project D<</module>
>   </modules>
> </project>
>
> Am I missing something here?
> --
> View this message in context: http://www.nabble.com/issue-with-mvn-clean-install-t1516559.html#a4116302
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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