maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LevskiWeng <levskiw...@gmail.com>
Subject Re: Why does Maven fail to compile my project occasionally?
Date Mon, 17 Feb 2014 03:43:12 GMT
Robert Scholte-4 wrote
> "My code is correct because I could successfully build the whole project  
> in Eclipse again and again."
> This is 100% true. Within Eclipse you can manually add libraries.  
> Actually, if you create your first JUnit test, Eclipse will ask if the  
> JUnit4 library should be added. If you do so, it's added as an Eclipse  
> library, but your Maven build won't have junit as a dependency, resulting  
> in uncompilable tests.

I'm add all necessary dependent libraries that I know in pom.xml. It looks
weird and I've no idea about it. Could you help me to diagnose the problem
further?


Robert Scholte-4 wrote
> Did you open this file?
> AgentIdResourceMapIpHandle.java:[36,24] refers to line 36, column 24. Just  
> open that file with notepad (copy/paste the fully qualified path to ensure  
> you're picking up the correct file, not some copy)
> Where is that "symbol"/Class coming from? It seems to be on the classpath  
> of your Eclipse, but it is not a dependency for Maven.
> 
> Robert

I guess I've declared all dependent packages in the pom.xml.
The content of AgentIdResourceMapIpHandle.java is: (I omit the unimportant
lines)


> package com.xxx.system.devicecenter.network;
> 
> import com.xxx.system.common.ResourceTypeDef;
> import com.xxx.system.network.IResourceMapIpHandle;
> // Imports some other packages...
> 
> public class AgentIdResourceMapIpHandle implements IResourceMapIpHandle {
>     @Override
>     public Integer getType() {
>         return ResourceTypeDef.TYPE_AGENT_ID;
>     }
>     // Implements other methods declared in interface
> IResourceMapIpHandle...
> }

And the content of the pom.xml for com.xxx.system.devicecenter is:

> <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/xsd/maven-4.0.0.xsd">
> 	
> <modelVersion>
> 4.0.0
> </modelVersion>
> 	
> <parent>
> 		
> <artifactId>
> systempom
> </artifactId>
> 		
> <groupId>
> com.xxx.system
> </groupId>
> 		
> <version>
> 1.0.0
> </version>
> 	
> </parent>
> 	
> <groupId>
> com.xxx.system
> </groupId>
>  
> 	
> <artifactId>
> devicecenter
> </artifactId>
> 	
> <version>
> 1.0.0-SNAPSHOT
> </version>
> 	
> <dependencies>
> 		
> <dependency>
> 			
> <groupId>
> com.xxx.system
> </groupId>
> 			
> <artifactId>
> network
> </artifactId>
> 			
> <version>
> 1.1.0
> </version>
> 		
> </dependency>
> 	
> </dependencies>
> 	
> <build>
> 		
> <plugins>
> 			
> <plugin>
> 				
> <artifactId>
> maven-release-plugin
> </artifactId>
> 				
> <version>
> 2.3.1
> </version>
> 				
> <configuration>
> 					
> <tagBase>
> https://192.168.49.48:8443/svn/cms/tag/cdms_plugins/com.xxx.core/com.xxx.core.jettyweb
> </tagBase>
> 					
> <useReleaseProfile>
> false
> </useReleaseProfile>
> 				
> </configuration>
> 			
> </plugin>
> 			
> <plugin>
> 				
> <artifactId>
> maven-antrun-plugin
> </artifactId>
> 			
> </plugin>
> 			
> <plugin>
> 				
> <artifactId>
> maven-dependency-plugin
> </artifactId>
> 			
> </plugin>
> 			
> <plugin>
> 				
> <artifactId>
> maven-source-plugin
> </artifactId>
> 			
> </plugin>
> 			
> <plugin>
> 				
> <groupId>
> org.apache.maven.plugins
> </groupId>
> 				
> <artifactId>
> maven-jar-plugin
> </artifactId>
> 				
> <version>
> 2.3.1
> </version>
> 				
> <executions>
> 					
> <execution>
> 						
> <phase>
> package
> </phase>
> 					
> </execution>
> 				
> </executions>
> 				
> <configuration>
> 					
> <archive>
> 						
> <manifestEntries>
> 							
> <Active>
> com.xxx.core.web.PluginActive
> </Active>
> 						
> </manifestEntries>
> 					
> </archive>
> 				
> </configuration>
> 			
> </plugin>
> 		
> </plugins>
> 		
> <resources>
> 			
> <resource>
> 				
> <directory>
> src/main/java/
> </directory>
> 				
> <includes>
> 					
> <include>
> **/*.xml
> </include>
> 				
> </includes>
> 			
> </resource>
> 			
> <resource>
> 				
> <directory>
> src/main/resources/
> </directory>
> 				
> <includes>
> 					
> <include>
> *.xml
> </include>
> 				
> </includes>
> 			
> </resource>
> 		
> </resources>
> 	
> </build>
> </project>

The content of pom.xml of com.xxx.system.systempom is:

> <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/xsd/maven-4.0.0.xsd">
> 	
> <parent>
> 		
> <artifactId>
> pom
> </artifactId>
> 		
> <groupId>
> com.xxx
> </groupId>
> 		
> <version>
> 1.0.0
> </version>
> 	
> </parent>
> 	
> <modelVersion>
> 4.0.0
> </modelVersion>
> 	
> <groupId>
> com.xxx.system
> </groupId>
> 	
> <artifactId>
> systempom
> </artifactId>
> 	
> <version>
> 1.0.0
> </version>
> 	
> <packaging>
> pom
> </packaging>
> 	
> <scm>
> 		
> <connection>
> scm:svn:https://192.168.49.48:8443/svn/cms/trunk/cdms_server/common/com.xxx.system.pom
> </connection>
> 		
> <developerConnection>
> scm:svn:https://192.168.49.48:8443/svn/cms/trunk/cdms_server/common/com.xxx.system.pom
> </developerConnection>
> 	
> </scm>
> 	
> <properties>
> 		
> <project.type>
> system
> </project.type>
> 	
> </properties>
> 	
> <build>
> 		
> <pluginManagement>
> 			
> <plugins>
> 				
> <plugin>
> 					
> <artifactId>
> maven-release-plugin
> </artifactId>
> 					
> <version>
> 2.3.1
> </version>
> 					
> <configuration>
> 						
> <tagBase>
> https://192.168.49.48:8443/svn/cms/tag/cdms_plugins/common/com.xxx.system.pom
> </tagBase>
> 						
> <useReleaseProfile>
> false
> </useReleaseProfile>
> 					
> </configuration>
> 				
> </plugin>
> 			
> </plugins>
> 		
> </pluginManagement>
> 	
> </build>
> 	
> <dependencies>
> 		
> <dependency>
> 			
> <groupId>
> com.xxx
> </groupId>
> 			
> <artifactId>
> util
> </artifactId>
> 			
> <version>
> 1.1.0-SNAPSHOT
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> com.xxx.core
> </groupId>
> 			
> <artifactId>
> plugin-framework
> </artifactId>
> 			
> <version>
> 1.1.0-SNAPSHOT
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> com.xxx.core
> </groupId>
> 			
> <artifactId>
> third-integrate
> </artifactId>
> 			
> <version>
> 1.2.0-SNAPSHOT
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> org.springframework
> </groupId>
> 			
> <artifactId>
> spring
> </artifactId>
> 			
> <version>
> ${spring.version}
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> org.hibernate
> </groupId>
> 			
> <artifactId>
> hibernate
> </artifactId>
> 			
> <version>
> 3.2.7.ga
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> org.springframework
> </groupId>
> 			
> <artifactId>
> spring-test
> </artifactId>
> 			
> <version>
> ${spring.version}
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> test
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> c3p0
> </groupId>
> 			
> <artifactId>
> c3p0
> </artifactId>
> 			
> <version>
> 0.9.1.2
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> mysql
> </groupId>
> 			
> <artifactId>
> mysql-connector-java
> </artifactId>
> 			
> <version>
> 5.1.15
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> com.microsoft.sqlserver
> </groupId>
> 			
> <artifactId>
> sqljdbc4
> </artifactId>
> 			
> <version>
> 4.0
> </version>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> com.xxx.core
> </groupId>
> 			
> <artifactId>
> jettyweb
> </artifactId>
> 			
> <version>
> 1.1.0-SNAPSHOT
> </version>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> org.quartz-scheduler
> </groupId>
> 			
> <artifactId>
> quartz
> </artifactId>
> 			
> <version>
> 1.8.4
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> com.xxx.core
> </groupId>
> 			
> <artifactId>
> deploy
> </artifactId>
> 			
> <version>
> 1.1.0-SNAPSHOT
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 		
> <dependency>
> 			
> <groupId>
> com.xxx.system
> </groupId>
> 			
> <artifactId>
> common
> </artifactId>
> 			
> <version>
> 1.2.0-SNAPSHOT
> </version>
> 			
> <type>
> jar
> </type>
> 			
> <scope>
> compile
> </scope>
> 		
> </dependency>
> 	
> </dependencies>
> </project>

Any ideas? 



--
View this message in context: http://maven.40175.n5.nabble.com/Why-does-Maven-fail-to-compile-my-project-occasionally-tp5784849p5785124.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


Mime
View raw message