Log4J - cannot find symbol - method trace(String)
Hi everyone, I have the following dependency in my project's POM: ... dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.17/version /dependency ... The artifact is downloaded to my local repository, but, during the compile phase, the following error is emitted and the build process is aborted: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project dbtoixattrdt: Compilation failure: Compilation failure: [ERROR] d:\prace\dbtoixattrdt\DBToIXATTRDT-TRUNK\src\main\java\dbtoixattrdt\TraceLogAspect.java:[19,8] error: cannot find symbol [ERROR] symbol: method trace(String) [ERROR] location: variable logger of type Logger This error message does not make much sense, as the trace method should be available on the Logger class in Log4J version 1.2.17. What can be wrong? Thanks in advance, Dušan
Re: Log4J - cannot find symbol - method trace(String)
You can use the dependency:tree[1] goal to view a tree of your dependencies to see if the correct version of Log4J is being included in the compiler classpath. [1] https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 1:41 PM, Dušan Rychnovský geraltzri...@gmail.com wrote: Hi everyone, I have the following dependency in my project's POM: ... dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.17/version /dependency ... The artifact is downloaded to my local repository, but, during the compile phase, the following error is emitted and the build process is aborted: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project dbtoixattrdt: Compilation failure: Compilation failure: [ERROR] d:\prace\dbtoixattrdt\DBToIXATTRDT-TRUNK\src\main\java\dbtoixattrdt\TraceLogAspect.java:[19,8] error: cannot find symbol [ERROR] symbol: method trace(String) [ERROR] location: variable logger of type Logger This error message does not make much sense, as the trace method should be available on the Logger class in Log4J version 1.2.17. What can be wrong? Thanks in advance, Dušan - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Log4J - cannot find symbol - method trace(String)
Also check your java imports, just in case you’ve imported a different Logger by mistake (such as java.util.logging.Logger) On 30 Apr 2014, at 12:48, Nick Stolwijk nick.stolw...@gmail.com wrote: You can use the dependency:tree[1] goal to view a tree of your dependencies to see if the correct version of Log4J is being included in the compiler classpath. [1] https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 1:41 PM, Dušan Rychnovský geraltzri...@gmail.com wrote: Hi everyone, I have the following dependency in my project's POM: ... dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.17/version /dependency ... The artifact is downloaded to my local repository, but, during the compile phase, the following error is emitted and the build process is aborted: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project dbtoixattrdt: Compilation failure: Compilation failure: [ERROR] d:\prace\dbtoixattrdt\DBToIXATTRDT-TRUNK\src\main\java\dbtoixattrdt\TraceLogAspect.java:[19,8] error: cannot find symbol [ERROR] symbol: method trace(String) [ERROR] location: variable logger of type Logger This error message does not make much sense, as the trace method should be available on the Logger class in Log4J version 1.2.17. What can be wrong? Thanks in advance, Dušan - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Log4J - cannot find symbol - method trace(String)
Thank you both for your help. Unfortunatelly, neither seems to be the case. * dependency:tree confirmed that version 1.2.17 is beeing used indeed (log4j:log4j:jar:1.2.17:compile), * I have verified that the import statement is correct (import org.apache.log4j.Logger;). Dušan 2014-04-30 13:55 GMT+02:00 Stuart McCulloch mccu...@gmail.com: Also check your java imports, just in case you’ve imported a different Logger by mistake (such as java.util.logging.Logger) On 30 Apr 2014, at 12:48, Nick Stolwijk nick.stolw...@gmail.com wrote: You can use the dependency:tree[1] goal to view a tree of your dependencies to see if the correct version of Log4J is being included in the compiler classpath. [1] https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 1:41 PM, Dušan Rychnovský geraltzri...@gmail.com wrote: Hi everyone, I have the following dependency in my project's POM: ... dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.17/version /dependency ... The artifact is downloaded to my local repository, but, during the compile phase, the following error is emitted and the build process is aborted: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project dbtoixattrdt: Compilation failure: Compilation failure: [ERROR] d:\prace\dbtoixattrdt\DBToIXATTRDT-TRUNK\src\main\java\dbtoixattrdt\TraceLogAspect.java:[19,8] error: cannot find symbol [ERROR] symbol: method trace(String) [ERROR] location: variable logger of type Logger This error message does not make much sense, as the trace method should be available on the Logger class in Log4J version 1.2.17. What can be wrong? Thanks in advance, Dušan - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Log4J - cannot find symbol - method trace(String)
Could you check your checksum on the log4j jar file? Maybe there is some corruption in your repository. 02:28:40 ~/.m2/repository/log4j/log4j/1.2.17$ ls -altr log4j-1.2.17.jar -rw-r--r-- 1 nick nick 489884 Jan 8 13:31 log4j-1.2.17.jar 02:28:45 ~/.m2/repository/log4j/log4j/1.2.17$ sha1sum log4j-1.2.17.jar 5af35056b4d257e4b64b9e8069c0746e8b08629f log4j-1.2.17.jar 02:28:47 ~/.m2/repository/log4j/log4j/1.2.17$ cat log4j-1.2.17.jar.sha1 5af35056b4d257e4b64b9e8069c0746e8b08629f Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 2:00 PM, Dušan Rychnovský geraltzri...@gmail.com wrote: Thank you both for your help. Unfortunatelly, neither seems to be the case. * dependency:tree confirmed that version 1.2.17 is beeing used indeed (log4j:log4j:jar:1.2.17:compile), * I have verified that the import statement is correct (import org.apache.log4j.Logger;). Dušan 2014-04-30 13:55 GMT+02:00 Stuart McCulloch mccu...@gmail.com: Also check your java imports, just in case you’ve imported a different Logger by mistake (such as java.util.logging.Logger) On 30 Apr 2014, at 12:48, Nick Stolwijk nick.stolw...@gmail.com wrote: You can use the dependency:tree[1] goal to view a tree of your dependencies to see if the correct version of Log4J is being included in the compiler classpath. [1] https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 1:41 PM, Dušan Rychnovský geraltzri...@gmail.com wrote: Hi everyone, I have the following dependency in my project's POM: ... dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.17/version /dependency ... The artifact is downloaded to my local repository, but, during the compile phase, the following error is emitted and the build process is aborted: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project dbtoixattrdt: Compilation failure: Compilation failure: [ERROR] d:\prace\dbtoixattrdt\DBToIXATTRDT-TRUNK\src\main\java\dbtoixattrdt\TraceLogAspect.java:[19,8] error: cannot find symbol [ERROR] symbol: method trace(String) [ERROR] location: variable logger of type Logger This error message does not make much sense, as the trace method should be available on the Logger class in Log4J version 1.2.17. What can be wrong? Thanks in advance, Dušan - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Log4J - cannot find symbol - method trace(String)
Are you using Eclipse? What does the editor say about the error? Quick fix? If you can download Eclipse/STS which includes Maven support and load up your project, you will find the error pretty quickly. Ron On 30/04/2014 8:00 AM, Dušan Rychnovský wrote: Thank you both for your help. Unfortunatelly, neither seems to be the case. * dependency:tree confirmed that version 1.2.17 is beeing used indeed (log4j:log4j:jar:1.2.17:compile), * I have verified that the import statement is correct (import org.apache.log4j.Logger;). Dušan 2014-04-30 13:55 GMT+02:00 Stuart McCulloch mccu...@gmail.com: Also check your java imports, just in case you’ve imported a different Logger by mistake (such as java.util.logging.Logger) On 30 Apr 2014, at 12:48, Nick Stolwijk nick.stolw...@gmail.com wrote: You can use the dependency:tree[1] goal to view a tree of your dependencies to see if the correct version of Log4J is being included in the compiler classpath. [1] https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 1:41 PM, Dušan Rychnovský geraltzri...@gmail.com wrote: Hi everyone, I have the following dependency in my project's POM: ... dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.17/version /dependency ... The artifact is downloaded to my local repository, but, during the compile phase, the following error is emitted and the build process is aborted: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project dbtoixattrdt: Compilation failure: Compilation failure: [ERROR] d:\prace\dbtoixattrdt\DBToIXATTRDT-TRUNK\src\main\java\dbtoixattrdt\TraceLogAspect.java:[19,8] error: cannot find symbol [ERROR] symbol: method trace(String) [ERROR] location: variable logger of type Logger This error message does not make much sense, as the trace method should be available on the Logger class in Log4J version 1.2.17. What can be wrong? Thanks in advance, Dušan -- Ron Wheeler President Artifact Software Inc email: rwhee...@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Log4J - cannot find symbol - method trace(String)
And for another thought: maybe of your other dependencies include the org.apache.log4j.Logger class but with a different version. Check with maven copy dependencies and a grep over the contents of all the jar files. Here is how I do it: 02:40:48 {master} ~/sandbox/bowling-nickstolwijk$ mvn dependency:copy-dependencies [INFO] Scanning for projects... [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO] [INFO] [INFO] Building bowling-nickstolwijk 1.0-SNAPSHOT [INFO] [INFO] [INFO] --- maven-dependency-plugin:2.8:copy-dependencies (default-cli) @ bowling-nickstolwijk --- [INFO] hamcrest-core-1.3.jar already exists in destination. [INFO] junit-4.11.jar already exists in destination. [INFO] hamcrest-library-1.3.jar already exists in destination. [INFO] mockito-core-1.9.5.jar already exists in destination. [INFO] objenesis-1.0.jar already exists in destination. [INFO] [INFO] BUILD SUCCESS [INFO] [INFO] Total time: 1.143 s [INFO] Finished at: 2014-04-30T14:41:08+01:00 [INFO] Final Memory: 9M/153M [INFO] 02:41:08 {master} ~/sandbox/bowling-nickstolwijk$ cd target/dependency/ 02:41:16 {master} ~/sandbox/bowling-nickstolwijk/target/dependency$ findjar.sh . Logger Starting search for JAR files from directory . Looking for the class Logger This might take a while... org/mockito/internal/debugging/VerboseMockInvocationLogger.class org/mockito/internal/debugging/VerboseMockInvocationLogger.java org/mockito/internal/util/ConsoleMockitoLogger.class org/mockito/internal/util/ConsoleMockitoLogger.java org/mockito/internal/util/MockitoLogger.class org/mockito/internal/util/MockitoLogger.java org/mockito/internal/util/SimpleMockitoLogger.class org/mockito/internal/util/SimpleMockitoLogger.java ./mockito-core-1.9.5.jar 02:41:20 {master} ~/sandbox/bowling-nickstolwijk/target/dependency$ cat ~/bin/findjar.sh #!/bin/sh # # findjar.sh by Samuli Kaski # VERBOSE=no if [ $# -ne 2 ]; then echo Usage: findjar.sh path classname; exit; fi STARTPATH=$1 CLASS=$2 echo Starting search for JAR files from directory $STARTPATH echo Looking for the class $CLASS echo echo This might take a while... echo for jar in `find $STARTPATH -name '*.jar'`; do BASENAME=`basename $jar` jar -tf $jar | grep $CLASS if [ $? -eq 0 ]; then echo $jar fi done Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 2:29 PM, Nick Stolwijk nick.stolw...@gmail.com wrote: Could you check your checksum on the log4j jar file? Maybe there is some corruption in your repository. 02:28:40 ~/.m2/repository/log4j/log4j/1.2.17$ ls -altr log4j-1.2.17.jar -rw-r--r-- 1 nick nick 489884 Jan 8 13:31 log4j-1.2.17.jar 02:28:45 ~/.m2/repository/log4j/log4j/1.2.17$ sha1sum log4j-1.2.17.jar 5af35056b4d257e4b64b9e8069c0746e8b08629f log4j-1.2.17.jar 02:28:47 ~/.m2/repository/log4j/log4j/1.2.17$ cat log4j-1.2.17.jar.sha1 5af35056b4d257e4b64b9e8069c0746e8b08629f Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 2:00 PM, Dušan Rychnovský geraltzri...@gmail.com wrote: Thank you both for your help. Unfortunatelly, neither seems to be the case. * dependency:tree confirmed that version 1.2.17 is beeing used indeed (log4j:log4j:jar:1.2.17:compile), * I have verified that the import statement is correct (import org.apache.log4j.Logger;). Dušan 2014-04-30 13:55 GMT+02:00 Stuart McCulloch mccu...@gmail.com: Also check your java imports, just in case you’ve imported a different Logger by mistake (such as java.util.logging.Logger) On 30 Apr 2014, at 12:48, Nick Stolwijk nick.stolw...@gmail.com wrote: You can use the dependency:tree[1] goal to view a tree of your dependencies to see if the correct version of Log4J is being included in the compiler classpath. [1] https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 1:41 PM, Dušan Rychnovský
Re: Log4J - cannot find symbol - method trace(String)
Thank you all, I have finally managed to find the root of the problem. Nick's warning about the possibility of a different Log4J version as a transitive dependency got me thinking and I tried disabling the dependencies, one at a time, to see what would happen. The errors disappeared after disabling a custom 3rd party library that I have installed to my local repository manually and after inspecting its contents it turned out that there is an older Log4J version packed inside the JAR along with the rest of the library. Thank you once more for all your quick responses, Dušan 2014-04-30 14:44 GMT+02:00 Nick Stolwijk nick.stolw...@gmail.com: And for another thought: maybe of your other dependencies include the org.apache.log4j.Logger class but with a different version. Check with maven copy dependencies and a grep over the contents of all the jar files. Here is how I do it: 02:40:48 {master} ~/sandbox/bowling-nickstolwijk$ mvn dependency:copy-dependencies [INFO] Scanning for projects... [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO] [INFO] [INFO] Building bowling-nickstolwijk 1.0-SNAPSHOT [INFO] [INFO] [INFO] --- maven-dependency-plugin:2.8:copy-dependencies (default-cli) @ bowling-nickstolwijk --- [INFO] hamcrest-core-1.3.jar already exists in destination. [INFO] junit-4.11.jar already exists in destination. [INFO] hamcrest-library-1.3.jar already exists in destination. [INFO] mockito-core-1.9.5.jar already exists in destination. [INFO] objenesis-1.0.jar already exists in destination. [INFO] [INFO] BUILD SUCCESS [INFO] [INFO] Total time: 1.143 s [INFO] Finished at: 2014-04-30T14:41:08+01:00 [INFO] Final Memory: 9M/153M [INFO] 02:41:08 {master} ~/sandbox/bowling-nickstolwijk$ cd target/dependency/ 02:41:16 {master} ~/sandbox/bowling-nickstolwijk/target/dependency$ findjar.sh . Logger Starting search for JAR files from directory . Looking for the class Logger This might take a while... org/mockito/internal/debugging/VerboseMockInvocationLogger.class org/mockito/internal/debugging/VerboseMockInvocationLogger.java org/mockito/internal/util/ConsoleMockitoLogger.class org/mockito/internal/util/ConsoleMockitoLogger.java org/mockito/internal/util/MockitoLogger.class org/mockito/internal/util/MockitoLogger.java org/mockito/internal/util/SimpleMockitoLogger.class org/mockito/internal/util/SimpleMockitoLogger.java ./mockito-core-1.9.5.jar 02:41:20 {master} ~/sandbox/bowling-nickstolwijk/target/dependency$ cat ~/bin/findjar.sh #!/bin/sh # # findjar.sh by Samuli Kaski # VERBOSE=no if [ $# -ne 2 ]; then echo Usage: findjar.sh path classname; exit; fi STARTPATH=$1 CLASS=$2 echo Starting search for JAR files from directory $STARTPATH echo Looking for the class $CLASS echo echo This might take a while... echo for jar in `find $STARTPATH -name '*.jar'`; do BASENAME=`basename $jar` jar -tf $jar | grep $CLASS if [ $? -eq 0 ]; then echo $jar fi done Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 2:29 PM, Nick Stolwijk nick.stolw...@gmail.com wrote: Could you check your checksum on the log4j jar file? Maybe there is some corruption in your repository. 02:28:40 ~/.m2/repository/log4j/log4j/1.2.17$ ls -altr log4j-1.2.17.jar -rw-r--r-- 1 nick nick 489884 Jan 8 13:31 log4j-1.2.17.jar 02:28:45 ~/.m2/repository/log4j/log4j/1.2.17$ sha1sum log4j-1.2.17.jar 5af35056b4d257e4b64b9e8069c0746e8b08629f log4j-1.2.17.jar 02:28:47 ~/.m2/repository/log4j/log4j/1.2.17$ cat log4j-1.2.17.jar.sha1 5af35056b4d257e4b64b9e8069c0746e8b08629f Hth, Nick Stolwijk ~~~ Try to leave this world a little better than you found it and, when your turn comes to die, you can die happy in feeling that at any rate you have not wasted your time but have done your best ~~~ Lord Baden-Powell On Wed, Apr 30, 2014 at 2:00 PM, Dušan Rychnovský geraltzri...@gmail.com wrote: Thank you both for your help. Unfortunatelly, neither seems to be the case. * dependency:tree confirmed that version 1.2.17 is beeing used indeed (log4j:log4j:jar:1.2.17:compile), * I have verified that the import statement is correct (import org.apache.log4j.Logger;). Dušan 2014-04-30 13:55 GMT+02:00 Stuart McCulloch mccu...@gmail.com:
Re: Help with converting existing ant build to maven is required - forking
I'm afraid I don't understand your advice :( Sorry maybe you have example project available? Or maybe you can take a look at my project parent http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/pom.xml?revision=HEADview=markup util http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-util/pom.xml?revision=HEADview=markup web http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/pom.xml?revision=HEADview=markup and tell me what need to be changed. working example will help a lot :) On Wed, Apr 30, 2014 at 11:11 AM, Ron Wheeler rwhee...@artifact-software.com wrote: So, as far as Maven is concerned, Red5 is scope provided. You want it to reference it for compiling but should not put its classes in the jar or war since you are going to sneak it into the package without Maven noticing. Pretty standard problem. We make a lot of aggregation jars that are used in the same way. http://blog.artifact-software.com/tech/?p=121 describes how we handle a similar need to produce skinny wars that use libraries in Tomcar/shared or tomcat/lib to avoid copies of the same code in multiple jars. Our LMS project has over 80 Maven projects that produce a variety of jars and wars. Many of these share the use of large libraries such as CXF, Spring and Apache commons that can be shared through Tomcat's classloader rather than duplicated in each war. There are some other notes about Maven on our blog that you might find interesting. I would prefer an installer to get the shared libraries into tomcat/lib but that is another issue. Ron On 29/04/2014 10:24 PM, Maxim Solodovnik wrote: Here is the structure: Openmeetings Util project has compile time dependency Red5 server Almost all other projects are dependent on Openmeetings Util and Red5 server (compile time) But When I'm creating war file in Openmeetings Web project I need to remove Red5 server and all it dependencies from the WEB-INF/lib folder since all these jar files will be placed into tomcat/lib folder. On Wed, Apr 30, 2014 at 4:43 AM, Ron Wheeler rwheeler@artifact-software. com wrote: Where will the transitive dependencies come from? There may be ways to do what you want. Ron On 29/04/2014 1:44 PM, Maxim Solodovnik wrote: Additional question: Is it possible to exclude compile time dependency (with all transitive sub-dependencies) form war libraries? (without listing libraries one by one) On Tue, Apr 29, 2014 at 9:44 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello Ron, I'll take a look at izPack as an alternative to assembly plugin (which seems to be able to create artifact similar to the current being created by ant) Currently I'm trying to build all jars/war/swf files need to be packed (by assembly plugin or izPack) Here is the stripped output of my current maven build: http://pastebin.com/XvbA9yGM As you can see, after normal build all projects are being forked: 1. [INFO] 2. [INFO] Forking Openmeetings Util 3.1.0-SNAPSHOT 3. [INFO] 4. etc. if I'm building single project using: mvn clean install -pl openmeetings-web -am I see no forking Will appreciate any help on this On Tue, Apr 29, 2014 at 9:25 PM, Ron Wheeler rwhee...@artifact-software.com wrote: Can you describe the forking Maven problem in more detail. What does it do that you don't want and what does it not do that you need. Is there anything about your build that is different from the thousands of projects that use Maven to build Tomcat applications? Have you looked at using Maven to build an installer with izPack. This will let you use Maven to build the components and use the maven izPack plug-in to build a user-friendly deployment tool that lets a system admin install all of your components in the right places with the required permissions, initialization, etc. that may be required. Ron On 29/04/2014 10:13 AM, Maxim Solodovnik wrote: Thanks Russ! I was hoping there is a way to avoid specifying parent version in every sub-project. But it seems to be Maven way :) Maybe you know how to manage project forking? My projects are being build several times and the result of building parent project is unpredictable for whatever reason :( On Tue, Apr 29, 2014 at 9:04 PM, Russell Gold r...@gold-family.us wrote: HI Maxim, Here is how I do child projects: parent groupIdcom.meterware.totalizer/groupId artifactIdtotalizer/artifactId version1.0-SNAPSHOT/version relativePath../relativePath /parent artifactIdserver/artifactId Note that I am specifying the parent project, but neither the group nor the version for the child project - just the artifactId. The others are automatically inherited. Regards, Russ On Apr 26, 2014, at 3:38 AM, Maxim Solodovnik solomax...@gmail.com wrote: Hello All,
Re: Help with converting existing ant build to maven is required - forking
I don't have time to look at code and projects for free. If you need consulting to move forward, there are others here that do Maven for a business and can help you better than I can. Have you tried making the red5 scope provided. What does this do to your build? Does it get eliminate the red5 classes from your jar so that it only appears in the assembled war as a resource? To make life simpler, remove all code from the war project and put it into a separate project that makes a jar that the war depends on. This will make it clearer when you need red5 to compile your code and when you need it to build a deployable war. It will have scope provided as a dependency in your jar project. Do you have specific questions about my blog articles on Maven and aggregation jars? Ron On 30/04/2014 11:44 AM, Maxim Solodovnik wrote: I'm afraid I don't understand your advice :( Sorry maybe you have example project available? Or maybe you can take a look at my project parent http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/pom.xml?revision=HEADview=markup util http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-util/pom.xml?revision=HEADview=markup web http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/pom.xml?revision=HEADview=markup and tell me what need to be changed. working example will help a lot :) On Wed, Apr 30, 2014 at 11:11 AM, Ron Wheeler rwhee...@artifact-software.com wrote: So, as far as Maven is concerned, Red5 is scope provided. You want it to reference it for compiling but should not put its classes in the jar or war since you are going to sneak it into the package without Maven noticing. Pretty standard problem. We make a lot of aggregation jars that are used in the same way. http://blog.artifact-software.com/tech/?p=121 describes how we handle a similar need to produce skinny wars that use libraries in Tomcar/shared or tomcat/lib to avoid copies of the same code in multiple jars. Our LMS project has over 80 Maven projects that produce a variety of jars and wars. Many of these share the use of large libraries such as CXF, Spring and Apache commons that can be shared through Tomcat's classloader rather than duplicated in each war. There are some other notes about Maven on our blog that you might find interesting. I would prefer an installer to get the shared libraries into tomcat/lib but that is another issue. Ron On 29/04/2014 10:24 PM, Maxim Solodovnik wrote: Here is the structure: Openmeetings Util project has compile time dependency Red5 server Almost all other projects are dependent on Openmeetings Util and Red5 server (compile time) But When I'm creating war file in Openmeetings Web project I need to remove Red5 server and all it dependencies from the WEB-INF/lib folder since all these jar files will be placed into tomcat/lib folder. On Wed, Apr 30, 2014 at 4:43 AM, Ron Wheeler rwheeler@artifact-software. com wrote: Where will the transitive dependencies come from? There may be ways to do what you want. Ron On 29/04/2014 1:44 PM, Maxim Solodovnik wrote: Additional question: Is it possible to exclude compile time dependency (with all transitive sub-dependencies) form war libraries? (without listing libraries one by one) On Tue, Apr 29, 2014 at 9:44 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello Ron, I'll take a look at izPack as an alternative to assembly plugin (which seems to be able to create artifact similar to the current being created by ant) Currently I'm trying to build all jars/war/swf files need to be packed (by assembly plugin or izPack) Here is the stripped output of my current maven build: http://pastebin.com/XvbA9yGM As you can see, after normal build all projects are being forked: 1. [INFO] 2. [INFO] Forking Openmeetings Util 3.1.0-SNAPSHOT 3. [INFO] 4. etc. if I'm building single project using: mvn clean install -pl openmeetings-web -am I see no forking Will appreciate any help on this On Tue, Apr 29, 2014 at 9:25 PM, Ron Wheeler rwhee...@artifact-software.com wrote: Can you describe the forking Maven problem in more detail. What does it do that you don't want and what does it not do that you need. Is there anything about your build that is different from the thousands of projects that use Maven to build Tomcat applications? Have you looked at using Maven to build an installer with izPack. This will let you use Maven to build the components and use the maven izPack plug-in to build a user-friendly deployment tool that lets a system admin install all of your components in the right places with the required permissions, initialization, etc. that may be required. Ron On 29/04/2014 10:13 AM, Maxim Solodovnik wrote: Thanks Russ! I was hoping there is a way to avoid specifying parent version in every sub-project. But it seems to be Maven way :) Maybe you know how to manage project forking? My projects
Finding unused dependencies
Hi Users, I wonder whether there's an easy way to find unused dependencies for a module.I have a module which has bunch of dependencies, I have removed most of them but I wonder whether there's an easy way rather manually doing it. I there a way to get a warning about unused dependency in a pom file for a given module. Thanks Lahiru -- System Analyst Programmer PTI Lab Indiana University
Re: Finding unused dependencies
Hi Lahiru, I there a way to get a warning about unused dependency in a pom file for a given module. mvn dependency:analyze Regards, Curtis On Wed, Apr 30, 2014 at 3:35 PM, Lahiru Gunathilake glah...@gmail.comwrote: Hi Users, I wonder whether there's an easy way to find unused dependencies for a module.I have a module which has bunch of dependencies, I have removed most of them but I wonder whether there's an easy way rather manually doing it. I there a way to get a warning about unused dependency in a pom file for a given module. Thanks Lahiru -- System Analyst Programmer PTI Lab Indiana University
Multimodule Configuration of Checkstyle-plugin errors
Hi everyone! I added checkstyle-plugin in the project according to the site - http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html But I got an error: [INFO] Scanning for projects ... [ERROR] The projects in the reactor contain a cyclic reference: Edge between 'Vertex {label =' eu.stratosphere: stratosphere-dist :0.5-SNAPSHOT '}' and 'Vertex {label =' eu.stratosphere: stratosphere-core: 0.5-SNAPSHOT '}' introduces to cycle in the graph eu.stratosphere: stratosphere-core :0.5-SNAPSHOT - eu.stratosphere: stratosphere-dist :0.5-SNAPSHOT - eu.stratosphere: stratosphere-core: 0.5- SNAPSHOT - [Help 1] [ERROR] Commit with the addition of plug-in - https://github.com/alexff91/stratosphere/commit/d57bd5df3be7d9eac0454627cb643d16003133e9 My configuration : Maven + Version - 3.0.4 Windows 8 64 -bit Java - 1.7.0_25 With another configurations I got: [INFO] Scanning for projects ... [ERROR] Internal error: java.lang.NullPointerException - [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException at org.apache.maven.DefaultMaven.execute (DefaultMaven.java: 167) at org.apache.maven.cli.MavenCli.execute (MavenCli.java: 584 ) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java: 213) Console output can be found here : https://travis-ci.org/alexff91/stratosphere/builds/24120318 -- With best wishes and regards, Fedorov Aleksandr.
Netbeans maven project with invalid POM/classpath problem
Hi , I am new to Maven and Glassfish (and pretty new to Java and Netbeans!) and am struggling to build a JPA based 'injection' project that I want to run as an application client (using Glassfish appclient) to inject rows from an Oracle db table into a JMS queue. Specifically the problem is: When I build the 'injection' project' I get an invalid pom message but it builds. The POM for com.oracle:ojdbc6:jar:11.2.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details Running it with appclient however it fails as I get the following error: org.eclipse.persistence.DatabaseException. Exception description: Configuration error message - Class [oracle.jdbc.Oracle driver] not found. Browsing the local Maven repository using Netbeans I find the following if I right-click on the ojdbc 11.2.0 jar and select 'View Details' -- org.apache.maven.project.InvalidProjectModelException: 1 problem was encountered while building the effective model [FATAL] Non-parseable POM C:\Users\mcedward\.m2\repository\com\oracle\ojdbc6\11.2.0\ojdbc6-11.2.0.pom: end tag name /body must be the same as start tag meta from line 142 (position: TEXT seen ...!-- End of carousel script --\n/body... @453:8) @ line 453, column 8 for project for project at org.apache.maven.project.DefaultMavenProjectBuilder.transformError(DefaultMavenProjectBuilder.java:193) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:240) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:258) at org.netbeans.modules.maven.repository.ui.ArtifactMultiViewFactory.readMavenProject(ArtifactMultiViewFactory.java:231) at org.netbeans.modules.maven.repository.ui.ArtifactMultiViewFactory.access$000(ArtifactMultiViewFactory.java:104) at org.netbeans.modules.maven.repository.ui.ArtifactMultiViewFactory$1.run(ArtifactMultiViewFactory.java:187) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) -- It says this could be because : - I'm offline (but I'm not) - The repository content is wrong - no reason to suppose it is - The project or dependences cannot be resolved for the given set of repositories - no reason to suppose this either - 'Find Usages' seems to give the right answer - bug in the Maven or Netbeans codebase -? Hence posting to Netbeans and Maven forums I have successfully compiled and run an early version that just loads text to JMS so have got appclient to run successfully. I now want to use JPA to read the db. I have a separate Maven 'persistence' project that defines the persistence entities and have used this successfuly with another 'generation' project that generates the database table content in the first place. When I build the persistence project I get the same 'Invalid POM' message but it still works fine when included as a compile-time dependency in the 'generation' project. The persistence project has the following POM: --- ?xml version=1.0 encoding=UTF-8? 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; modelVersion4.0.0/modelVersion groupIdcom.oracle/groupId artifactIdcepdemodatagen/artifactId version1.0-SNAPSHOT/version packagingjar/packaging dependencies dependency groupIdorg.eclipse.persistence/groupId artifactIdjavax.persistence/artifactId version2.1.0/version typejar/type /dependency dependency groupIdcepdemo/groupId artifactIdcepdemopersistence/artifactId version1.1-SNAPSHOT/version typejar/type /dependency dependency groupIdcom.oracle/groupId artifactIdcepdemopersistence/artifactId version1.0-SNAPSHOT/version typejar/type /dependency /dependencies properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding maven.compiler.source1.7/maven.compiler.source maven.compiler.target1.7/maven.compiler.target /properties /project - Note: cepdemopersistence-1.1-SNAPSHOT dependency is not used in any code - don't know how it got there! The 'injection' project has the following POM: -- ?xml version=1.0 encoding=UTF-8? 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
Re: Netbeans maven project with invalid POM/classpath problem
On 1 May 2014 06:48, Mark mark@gmail.com wrote: Browsing the local Maven repository using Netbeans I find the following if I right-click on the ojdbc 11.2.0 jar and select 'View Details' -- org.apache.maven.project.InvalidProjectModelException: 1 problem was encountered while building the effective model [FATAL] Non-parseable POM C:\Users\mcedward\.m2\ repository\com\oracle\ojdbc6\11.2.0\ojdbc6-11.2.0.pom: end tag name /body must be the same as start tag meta from line 142 (position: TEXT seen ...!-- End of carousel script --\n/body... @453:8) @ line 453, column 8 for project for project at org.apache.maven.project.DefaultMavenProjectBuilder. transformError(DefaultMavenProjectBuilder.java:193) at org.apache.maven.project.DefaultMavenProjectBuilder. buildFromRepository(DefaultMavenProjectBuilder.java:240) at org.apache.maven.project.DefaultMavenProjectBuilder. buildFromRepository(DefaultMavenProjectBuilder.java:251) at org.apache.maven.project.DefaultMavenProjectBuilder. buildFromRepository(DefaultMavenProjectBuilder.java:258) at org.netbeans.modules.maven.repository.ui. ArtifactMultiViewFactory.readMavenProject(ArtifactMultiViewFactory.java: 231) at org.netbeans.modules.maven.repository.ui. ArtifactMultiViewFactory.access$000(ArtifactMultiViewFactory.java:104) at org.netbeans.modules.maven.repository.ui. ArtifactMultiViewFactory$1.run(ArtifactMultiViewFactory.java:187) at org.openide.util.RequestProcessor$Task.run( RequestProcessor.java:1423) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) Have you opened that file in a text editor? It looks like malformed xml to me. How did you install the ojdbc jars? These need to be manually installed since they require you to agree to the OTN License Agreement.
Re: Help with converting existing ant build to maven is required - forking
Thanks for your time I have started with making red5 provided but the build failed since necessary classes were not found. May be is there any way to provide dependency before build ... If not I will try to create optional dependency and another one subproject, not sure if it will work. I believe the blog article would be better if you can extend it a little bit and improve the formatting. Actually I can't se how it can help me :( Thanks for the help :) On Wed, Apr 30, 2014 at 11:22 PM, Ron Wheeler rwhee...@artifact-software.com wrote: I don't have time to look at code and projects for free. If you need consulting to move forward, there are others here that do Maven for a business and can help you better than I can. Have you tried making the red5 scope provided. What does this do to your build? Does it get eliminate the red5 classes from your jar so that it only appears in the assembled war as a resource? To make life simpler, remove all code from the war project and put it into a separate project that makes a jar that the war depends on. This will make it clearer when you need red5 to compile your code and when you need it to build a deployable war. It will have scope provided as a dependency in your jar project. Do you have specific questions about my blog articles on Maven and aggregation jars? Ron On 30/04/2014 11:44 AM, Maxim Solodovnik wrote: I'm afraid I don't understand your advice :( Sorry maybe you have example project available? Or maybe you can take a look at my project parent http://svn.apache.org/viewvc/openmeetings/trunk/ singlewebapp/pom.xml?revision=HEADview=markup util http://svn.apache.org/viewvc/openmeetings/trunk/ singlewebapp/openmeetings-util/pom.xml?revision=HEADview=markup web http://svn.apache.org/viewvc/openmeetings/trunk/ singlewebapp/openmeetings-web/pom.xml?revision=HEADview=markup and tell me what need to be changed. working example will help a lot :) On Wed, Apr 30, 2014 at 11:11 AM, Ron Wheeler rwhee...@artifact-software.com wrote: So, as far as Maven is concerned, Red5 is scope provided. You want it to reference it for compiling but should not put its classes in the jar or war since you are going to sneak it into the package without Maven noticing. Pretty standard problem. We make a lot of aggregation jars that are used in the same way. http://blog.artifact-software.com/tech/?p=121 describes how we handle a similar need to produce skinny wars that use libraries in Tomcar/shared or tomcat/lib to avoid copies of the same code in multiple jars. Our LMS project has over 80 Maven projects that produce a variety of jars and wars. Many of these share the use of large libraries such as CXF, Spring and Apache commons that can be shared through Tomcat's classloader rather than duplicated in each war. There are some other notes about Maven on our blog that you might find interesting. I would prefer an installer to get the shared libraries into tomcat/lib but that is another issue. Ron On 29/04/2014 10:24 PM, Maxim Solodovnik wrote: Here is the structure: Openmeetings Util project has compile time dependency Red5 server Almost all other projects are dependent on Openmeetings Util and Red5 server (compile time) But When I'm creating war file in Openmeetings Web project I need to remove Red5 server and all it dependencies from the WEB-INF/lib folder since all these jar files will be placed into tomcat/lib folder. On Wed, Apr 30, 2014 at 4:43 AM, Ron Wheeler rwheeler@artifact-software. com wrote: Where will the transitive dependencies come from? There may be ways to do what you want. Ron On 29/04/2014 1:44 PM, Maxim Solodovnik wrote: Additional question: Is it possible to exclude compile time dependency (with all transitive sub-dependencies) form war libraries? (without listing libraries one by one) On Tue, Apr 29, 2014 at 9:44 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello Ron, I'll take a look at izPack as an alternative to assembly plugin (which seems to be able to create artifact similar to the current being created by ant) Currently I'm trying to build all jars/war/swf files need to be packed (by assembly plugin or izPack) Here is the stripped output of my current maven build: http://pastebin.com/XvbA9yGM As you can see, after normal build all projects are being forked: 1. [INFO] 2. [INFO] Forking Openmeetings Util 3.1.0-SNAPSHOT 3. [INFO] 4. etc. if I'm building single project using: mvn clean install -pl openmeetings-web -am I see no forking Will appreciate any help on this On Tue, Apr 29, 2014 at 9:25 PM, Ron Wheeler rwhee...@artifact-software.com wrote: Can you describe the forking Maven problem in more detail. What does it do that you don't want and what does it not do that you need. Is there anything about your build that is different from the
Re: Help with converting existing ant build to maven is required - forking
Make the dependency optional seems to help :) On Thu, May 1, 2014 at 7:43 AM, Maxim Solodovnik solomax...@gmail.comwrote: Thanks for your time I have started with making red5 provided but the build failed since necessary classes were not found. May be is there any way to provide dependency before build ... If not I will try to create optional dependency and another one subproject, not sure if it will work. I believe the blog article would be better if you can extend it a little bit and improve the formatting. Actually I can't se how it can help me :( Thanks for the help :) On Wed, Apr 30, 2014 at 11:22 PM, Ron Wheeler rwhee...@artifact-software.com wrote: I don't have time to look at code and projects for free. If you need consulting to move forward, there are others here that do Maven for a business and can help you better than I can. Have you tried making the red5 scope provided. What does this do to your build? Does it get eliminate the red5 classes from your jar so that it only appears in the assembled war as a resource? To make life simpler, remove all code from the war project and put it into a separate project that makes a jar that the war depends on. This will make it clearer when you need red5 to compile your code and when you need it to build a deployable war. It will have scope provided as a dependency in your jar project. Do you have specific questions about my blog articles on Maven and aggregation jars? Ron On 30/04/2014 11:44 AM, Maxim Solodovnik wrote: I'm afraid I don't understand your advice :( Sorry maybe you have example project available? Or maybe you can take a look at my project parent http://svn.apache.org/viewvc/openmeetings/trunk/ singlewebapp/pom.xml?revision=HEADview=markup util http://svn.apache.org/viewvc/openmeetings/trunk/ singlewebapp/openmeetings-util/pom.xml?revision=HEADview=markup web http://svn.apache.org/viewvc/openmeetings/trunk/ singlewebapp/openmeetings-web/pom.xml?revision=HEADview=markup and tell me what need to be changed. working example will help a lot :) On Wed, Apr 30, 2014 at 11:11 AM, Ron Wheeler rwhee...@artifact-software.com wrote: So, as far as Maven is concerned, Red5 is scope provided. You want it to reference it for compiling but should not put its classes in the jar or war since you are going to sneak it into the package without Maven noticing. Pretty standard problem. We make a lot of aggregation jars that are used in the same way. http://blog.artifact-software.com/tech/?p=121 describes how we handle a similar need to produce skinny wars that use libraries in Tomcar/shared or tomcat/lib to avoid copies of the same code in multiple jars. Our LMS project has over 80 Maven projects that produce a variety of jars and wars. Many of these share the use of large libraries such as CXF, Spring and Apache commons that can be shared through Tomcat's classloader rather than duplicated in each war. There are some other notes about Maven on our blog that you might find interesting. I would prefer an installer to get the shared libraries into tomcat/lib but that is another issue. Ron On 29/04/2014 10:24 PM, Maxim Solodovnik wrote: Here is the structure: Openmeetings Util project has compile time dependency Red5 server Almost all other projects are dependent on Openmeetings Util and Red5 server (compile time) But When I'm creating war file in Openmeetings Web project I need to remove Red5 server and all it dependencies from the WEB-INF/lib folder since all these jar files will be placed into tomcat/lib folder. On Wed, Apr 30, 2014 at 4:43 AM, Ron Wheeler rwheeler@artifact-software. com wrote: Where will the transitive dependencies come from? There may be ways to do what you want. Ron On 29/04/2014 1:44 PM, Maxim Solodovnik wrote: Additional question: Is it possible to exclude compile time dependency (with all transitive sub-dependencies) form war libraries? (without listing libraries one by one) On Tue, Apr 29, 2014 at 9:44 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello Ron, I'll take a look at izPack as an alternative to assembly plugin (which seems to be able to create artifact similar to the current being created by ant) Currently I'm trying to build all jars/war/swf files need to be packed (by assembly plugin or izPack) Here is the stripped output of my current maven build: http://pastebin.com/XvbA9yGM As you can see, after normal build all projects are being forked: 1. [INFO] 2. [INFO] Forking Openmeetings Util 3.1.0-SNAPSHOT 3. [INFO] 4. etc. if I'm building single project using: mvn clean install -pl openmeetings-web -am I see no forking Will appreciate any help on this On Tue, Apr 29, 2014 at 9:25 PM, Ron Wheeler rwhee...@artifact-software.com wrote: Can you describe the forking Maven problem in more detail. What