Re: reordering the lifecycle
On 28/04/2011 5:35 PM, Justin Lee wrote: I have a huge tree of ant based projects i'm trying to convert to maven. I have the mechanics worked about except for a minor hitch: I need the test phase to be the last one executed. Since all of this code is test code there will be no artifacts to install, no deployments run. But I need to, say, generate the war files before surefire kicks off and runs the test. How can I do that? Could I bind the surefire plugin to the install phase instead? Try to identify the Maven way to do what you are doing. Maven is not Ant. Don't be tempted to invent something new unless you are sure that no one else has ever tried to develop an application like yours. There is a Maven Best Practice for almost every situation and most likely thousands of people have already set up a project like yours. It somethings takes a bit of digging to find out the right way. Ron - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: maven-assembly-plugin StackOverflowError
Hello, did you ever resolve this issue? I ran into the same problem using poi 3.7 and maven-assembly-plugin 2.2.1. Cheers, Manuel-- View this message in context: http://maven.40175.n5.nabble.com/maven-assembly-plugin-StackOverflowError-tp3321403p4358228.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Logistic Regression
With some help from Ted (which I plan to turn into a checked-in tool if he doesn't get there first), I'm running LR on my initial small example. I adapted Ted's rcv1 sample to digest a directory containing subdirectories containing exemplars. Ted's delightfully small program pushes all of the data into the model 'n' times (n is 10 in my current variation. It displays the best learner's accuracy at each iteration. The example is 1000 docs in 10 categories. With 20k-features, I note that the accuracy scores get worse on each iteration of pushing the data into the model. After the first pass, the model hasn't trained yet. After the second, accuracy is 95.6%, and then if drifts gracefully downward with each additional iteration, landing at .83. I'm puzzled; I'm accustomed to overfitting causing scores to inflate, but this pattern is not intuitive to me. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Logistic Regression
This went to the wrong list. Apologies. On Fri, Apr 29, 2011 at 7:30 AM, Benson Margulies bimargul...@gmail.com wrote: With some help from Ted (which I plan to turn into a checked-in tool if he doesn't get there first), I'm running LR on my initial small example. I adapted Ted's rcv1 sample to digest a directory containing subdirectories containing exemplars. Ted's delightfully small program pushes all of the data into the model 'n' times (n is 10 in my current variation. It displays the best learner's accuracy at each iteration. The example is 1000 docs in 10 categories. With 20k-features, I note that the accuracy scores get worse on each iteration of pushing the data into the model. After the first pass, the model hasn't trained yet. After the second, accuracy is 95.6%, and then if drifts gracefully downward with each additional iteration, landing at .83. I'm puzzled; I'm accustomed to overfitting causing scores to inflate, but this pattern is not intuitive to me. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Logistic Regression
Re-reading your mail a few times I seriously hope that this was posted to the wrong list, as I don't understand anything...? /Anders On Fri, Apr 29, 2011 at 13:30, Benson Margulies bimargul...@gmail.comwrote: With some help from Ted (which I plan to turn into a checked-in tool if he doesn't get there first), I'm running LR on my initial small example. I adapted Ted's rcv1 sample to digest a directory containing subdirectories containing exemplars. Ted's delightfully small program pushes all of the data into the model 'n' times (n is 10 in my current variation. It displays the best learner's accuracy at each iteration. The example is 1000 docs in 10 categories. With 20k-features, I note that the accuracy scores get worse on each iteration of pushing the data into the model. After the first pass, the model hasn't trained yet. After the second, accuracy is 95.6%, and then if drifts gracefully downward with each additional iteration, landing at .83. I'm puzzled; I'm accustomed to overfitting causing scores to inflate, but this pattern is not intuitive to me. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Building a -classpath for a plugin, from the inside?
Owen: I think my previous reply got it half right: /** * @parameter expression=${plugin.artifacts} * @required * @readonly */ private ListArtifact pluginArtifacts; StringBuilder sb = new StringBuilder(); for (Artifact dep : pluginArtifacts) { sb.append(dep.getFile().toURI()).append(File.pathSeparator); } getLog().info(Plugin CP = + sb.toString()); On Thu, Apr 28, 2011 at 9:57 PM, Ryan Connolly ryn...@gmail.com wrote: Owen: As far as getting a nice pre-crafted classpath element string from the plugin's dependencies, I am not aware of an API call that will do that like we can for MavenProject classpaths (project.getRuntimeClasspathElements(), etc.). However, the plugin's dependencies are available in the following ways (maybe more): /** * @parameter expression=${plugin.artifacts} * @required */ private ListArtifact pluginArtifacts; /** * @parameter expression=${plugin.dependencies} * @required */ private ListDependency pluginDependencies; I think the classpath would need to be constructed by using the dependency info from above and resolving the artifacts from a repository as demonstrated in the following blog post. http://blogs.webtide.com/janb/entry/extending_the_maven_plugin_classpath Hope that helps. If others know of a better way to accomplish this I would be interested in this as well. -Ryan On Thu, Apr 28, 2011 at 7:27 PM, Owen Jacobson owen.jacob...@grimoire.cawrote: Hi folks, I'm working on upgrading a Maven plugin that runs Apache DS[0] to use the latest version of their software. Unfortunately, the latest version of their software does something slightly slack-jawed on startup: it inspects the java.class.path system property to locate JARs that contain core LDAP schemata. There is no alternate loader mechanism. When this happens inside a plugin, the java.class.path system property contains one JAR: Maven's own launcher JAR. I think the shortest path from where I am to working software is to fake up java.class.path before running Apache DS and then to reset it back to its real value after the server starts. However, in order to do this, I need to build a classpath-like string containing the JARs Apache DS needs. These JARs are already listed in the plugin's dependencies (and when the plugin runs, are available in the local repository). I'd like to use that information if possible, rather than hard-coding specific JAR names into the plugin. However, after spending half the day looking through various existing plugins, I'm no closer to doing this than I was this morning. 1. Is there a shortcut I missed that produces exactly the string (or list of JARs) I need? 2. If not, is there a reasonable way to obtain the dependency artifacts for a plugin? 3. If not, what's a better solution that doesn't involve patching Apache DS? -o [0] https://bitbucket.org/ojacobson/apacheds-maven-plugin/ - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Logistic Regression
Anders, I did send a message along afterwards apologizing. Did that not get through? Too many apache projects start with 'm'. --benson On Fri, Apr 29, 2011 at 7:37 AM, Anders Hammar and...@hammar.net wrote: Re-reading your mail a few times I seriously hope that this was posted to the wrong list, as I don't understand anything...? /Anders On Fri, Apr 29, 2011 at 13:30, Benson Margulies bimargul...@gmail.comwrote: With some help from Ted (which I plan to turn into a checked-in tool if he doesn't get there first), I'm running LR on my initial small example. I adapted Ted's rcv1 sample to digest a directory containing subdirectories containing exemplars. Ted's delightfully small program pushes all of the data into the model 'n' times (n is 10 in my current variation. It displays the best learner's accuracy at each iteration. The example is 1000 docs in 10 categories. With 20k-features, I note that the accuracy scores get worse on each iteration of pushing the data into the model. After the first pass, the model hasn't trained yet. After the second, accuracy is 95.6%, and then if drifts gracefully downward with each additional iteration, landing at .83. I'm puzzled; I'm accustomed to overfitting causing scores to inflate, but this pattern is not intuitive to me. - 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: Building a -classpath for a plugin, from the inside?
Owen Jacobson wrote: Hi folks, I'm working on upgrading a Maven plugin that runs Apache DS[0] to use the latest version of their software. Unfortunately, the latest version of their software does something slightly slack-jawed on startup: it inspects the java.class.path system property to locate JARs that contain core LDAP schemata. There is no alternate loader mechanism. When this happens inside a plugin, the java.class.path system property contains one JAR: Maven's own launcher JAR. I think the shortest path from where I am to working software is to fake up java.class.path before running Apache DS and then to reset it back to its real value after the server starts. However, in order to do this, I need to build a classpath-like string containing the JARs Apache DS needs. These JARs are already listed in the plugin's dependencies (and when the plugin runs, are available in the local repository). I'd like to use that information if possible, rather than hard-coding specific JAR names into the plugin. However, after spending half the day looking through various existing plugins, I'm no closer to doing this than I was this morning. 1. Is there a shortcut I missed that produces exactly the string (or list of JARs) I need? 2. If not, is there a reasonable way to obtain the dependency artifacts for a plugin? 3. If not, what's a better solution that doesn't involve patching Apache DS? Extracts from the AbstractJaxwsMojo in the jaxws-maven-plugin at Codehaus Mojo: = % = List classpathFiles = project.getCompileClasspathElements(); URL[] urls = new URL[classpathFiles.size()]; StringBuffer classPath = new StringBuffer(); for ( int i = 0; i classpathFiles.size(); ++i ) { urls[i] = new File( (String) classpathFiles.get( i ) ).toURL().toURI(); classPath.append( (String) classpathFiles.get( i ) ); classPath.append( File.pathSeparatorChar ); } URLClassLoader cl = new URLClassLoader( urls, Thread.currentThread().getContextClassLoader() ); Thread.currentThread().setContextClassLoader( cl ); System.setProperty( java.class.path, classPath.toString() ); = % = Obviously you should restore the classloader and system property later on. - Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Logistic Regression
I did send a message along afterwards apologizing. Did that not get through? I got it and assume everyone else did too. Too many apache projects start with 'm'. Simply to satisfy my curiousity, which project that starts with m were you talking about in your original email? ;-) Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Logistic Regression
On Fri, Apr 29, 2011 at 4:44 PM, Wayne Fay wayne...@gmail.com wrote: I did send a message along afterwards apologizing. Did that not get through? I got it and assume everyone else did too. Too many apache projects start with 'm'. Simply to satisfy my curiousity, which project that starts with m were you talking about in your original email? ;-) I'm going to guess... Mahout. :) -- Wendy - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Logistic Regression
Wendy got it in one. Mahout, Maven, Mojo, M2E. One slight slip of the fingers and the wrong one ends up in the gmail to box. On Fri, Apr 29, 2011 at 5:06 PM, Wendy Smoak wsm...@gmail.com wrote: On Fri, Apr 29, 2011 at 4:44 PM, Wayne Fay wayne...@gmail.com wrote: I did send a message along afterwards apologizing. Did that not get through? I got it and assume everyone else did too. Too many apache projects start with 'm'. Simply to satisfy my curiousity, which project that starts with m were you talking about in your original email? ;-) I'm going to guess... Mahout. :) -- Wendy - 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
Fwd: Problem resolving snapshot version of plugin thru a Mirror
Hi, i have been facing a problem when resolving snaphot version of plugin thru a mirror. It works well when there is no mirror. I have configured in my setting.xml repositories pointing out our Artifactory server and also a mirror pointing out to the same server to capture any request. In my case, i downloaded the latest version of maven-archetype-plugin (2.1-SNAPSHOT) from the svn's trunk. Then i deployed it in our artifactory server and ,finally, i deleted my whole local repo. Next, when running mvn archetype:generate, Maven tries to resolve latest version of the plugin , in this case snapshot, throwing the following error: /Reason: Error getting POM for 'org.apache.maven.plugins:maven-archetype-plugin' from the repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata. org.apache.maven.plugins:maven-archetype-plugin:pom:2.1-SNAPSHOT / Both plugin's and snapshot's maven-metadata are ok: *org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml* metadata groupIdorg.apache.maven.plugins/groupId artifactIdmaven-archetype-plugin/artifactId version2.1-SNAPSHOT/version versioning latest2.1-SNAPSHOT/latest release2.0/release versions version1.0-alpha-3/version version1.0-alpha-4/version version1.0-alpha-7/version version2.0-alpha-1/version version2.0-alpha-2/version version2.0-alpha-3/version version2.0-alpha-4/version version2.0-alpha-5/version version2.0/version version2.1-SNAPSHOT/version /versions lastUpdated20110420113107/lastUpdated /versioning /metadata *org/apache/maven/plugins/maven-archetype-plugin/2.1-SNAPSHOT/maven-metadata.xml* metadata groupIdorg.apache.maven.plugins/groupId artifactIdmaven-archetype-plugin/artifactId version2.1-SNAPSHOT/version versioning snapshot timestamp20110420.112731/timestamp buildNumber1/buildNumber /snapshot lastUpdated20110420111844/lastUpdated /versioning /metadata After debuging Maven I noticed that even having the mirror defined, SNAPSTHOP version of plugins always were resolved agains Maven`s central repository (repo1.apache.org). So we found a workaround overriding central and snapshot repositories in the setting xml. After that, it worked.
Installed local dependency compiles in maven, but resulting jar errors with NoClassDefFound on execution
The code imports classes from a compiled jar file. It can't access these classes even though I've installed the jar file in my local repository, listed it as a dependency in my pom.xml file, and it compiles happily. I've tried changing plugins and configuration based on advice in the archive, but it has only changed my error. Details -- I have some java code that is dependent on classes contained within a pre-compiled, third-party proprietary jar file called aipartner_api.jar. I have installed this jar in my local repository thusly: mvn install:install-file -Dfile=. \ -DgroupId=com.adinfuse.api \ -DartifactId=aipartner_api.jar \ -Dversion=1.0 \ -Dpackaging=jar \ -DgeneratePom=true so a copy lives here: YPCMC10030:target lbickle$ ls /Users/lbickle/.m2/repository/com/adinfuse/api/aipartner_api/1.0/ aipartner_api-1.0.jar aipartner_api-1.0.pom mvn clean package executes happily: YPCMC10030:api lbickle$ mvn clean package [INFO] Scanning for projects... [INFO] [INFO] Building Mobile Profiling Project -- Reporting API [INFO]task-segment: [clean, package] [INFO] [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting directory /Users/lbickle/Work/svn/aas/mpp/api/target [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/lbickle/Work/svn/aas/mpp/api/src/main/resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 1 source file to /Users/lbickle/Work/svn/aas/mpp/api/target/classes [INFO] [resources:testResources {execution: default-testResources}] [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/lbickle/Work/svn/aas/mpp/api/src/test/resources [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] No sources to compile [INFO] [surefire:test {execution: default-test}] [INFO] No tests to run. [INFO] [jar:jar {execution: default-jar}] [INFO] Building jar: /Users/lbickle/Work/svn/aas/mpp/api/target/reportingapi.jar [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 3 seconds [INFO] Finished at: Fri Apr 29 14:21:16 PDT 2011 [INFO] Final Memory: 22M/81M [INFO] When I used the maven-jar-plugin, I got an error, but, I read the archive and someone with a similar problem was pointed to this post: http://thomassundberg.wordpress.com/2011/03/05/create-an-executable-jar-from-maven/ Here's the error: YPCMC10030:target lbickle$ java -jar reportingapi.jar Exception in thread main java.lang.NoClassDefFoundError: com/adinfuse/api/Reporting Caused by: java.lang.ClassNotFoundException: com.adinfuse.api.Reporting at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) So, I changed my pom.xml to this: ?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/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion groupIdcom.atti.api/groupId artifactIdreportingapi/artifactId version1.0-SNAPSHOT/version nameMobile Profiling Project -- Reporting API/name packagingjar/packaging dependencies dependency groupIdcom.adinfuse.api/groupId artifactIdaipartner_api/artifactId version1.0/version /dependency /dependencies build finalName${artifactId}/finalName pluginManagement plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-assembly-plugin/artifactId version2.2.1/version executions execution idpackage-jar-with-dependencies/id phasepackage/phase goals goalsingle/goal /goals configuration appendAssemblyIdfalse/appendAssemblyId descriptorRefs
Re: Installed local dependency compiles in maven, but resulting jar errors with NoClassDefFound on execution
Listing things in your pom has no effect on the jar file that comes out at the end. If you want to build a self-contained jar, you need to read up on the maven-shade-plugin or the appassembler. On Fri, Apr 29, 2011 at 8:02 PM, Laura Bickle bickle.la...@gmail.com wrote: The code imports classes from a compiled jar file. It can't access these classes even though I've installed the jar file in my local repository, listed it as a dependency in my pom.xml file, and it compiles happily. I've tried changing plugins and configuration based on advice in the archive, but it has only changed my error. Details -- I have some java code that is dependent on classes contained within a pre-compiled, third-party proprietary jar file called aipartner_api.jar. I have installed this jar in my local repository thusly: mvn install:install-file -Dfile=. \ -DgroupId=com.adinfuse.api \ -DartifactId=aipartner_api.jar \ -Dversion=1.0 \ -Dpackaging=jar \ -DgeneratePom=true so a copy lives here: YPCMC10030:target lbickle$ ls /Users/lbickle/.m2/repository/com/adinfuse/api/aipartner_api/1.0/ aipartner_api-1.0.jar aipartner_api-1.0.pom mvn clean package executes happily: YPCMC10030:api lbickle$ mvn clean package [INFO] Scanning for projects... [INFO] [INFO] Building Mobile Profiling Project -- Reporting API [INFO] task-segment: [clean, package] [INFO] [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting directory /Users/lbickle/Work/svn/aas/mpp/api/target [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/lbickle/Work/svn/aas/mpp/api/src/main/resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 1 source file to /Users/lbickle/Work/svn/aas/mpp/api/target/classes [INFO] [resources:testResources {execution: default-testResources}] [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/lbickle/Work/svn/aas/mpp/api/src/test/resources [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] No sources to compile [INFO] [surefire:test {execution: default-test}] [INFO] No tests to run. [INFO] [jar:jar {execution: default-jar}] [INFO] Building jar: /Users/lbickle/Work/svn/aas/mpp/api/target/reportingapi.jar [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 3 seconds [INFO] Finished at: Fri Apr 29 14:21:16 PDT 2011 [INFO] Final Memory: 22M/81M [INFO] When I used the maven-jar-plugin, I got an error, but, I read the archive and someone with a similar problem was pointed to this post: http://thomassundberg.wordpress.com/2011/03/05/create-an-executable-jar-from-maven/ Here's the error: YPCMC10030:target lbickle$ java -jar reportingapi.jar Exception in thread main java.lang.NoClassDefFoundError: com/adinfuse/api/Reporting Caused by: java.lang.ClassNotFoundException: com.adinfuse.api.Reporting at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) So, I changed my pom.xml to this: ?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/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion groupIdcom.atti.api/groupId artifactIdreportingapi/artifactId version1.0-SNAPSHOT/version nameMobile Profiling Project -- Reporting API/name packagingjar/packaging dependencies dependency groupIdcom.adinfuse.api/groupId artifactIdaipartner_api/artifactId version1.0/version /dependency /dependencies build finalName${artifactId}/finalName pluginManagement plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-assembly-plugin/artifactId version2.2.1/version