Showing posts with label maven. Show all posts
Showing posts with label maven. Show all posts

Tuesday, August 27, 2013

Eclipse + maven: error compilation suddenly

Sometimes, you can see this error in eclipse.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
  C:\Program Files (x86)\Java\jre7\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error
This error happen when you compile eclipse and maven with jre. You must change to JDK compile in Eclise.

Thursday, June 27, 2013

publish with maven in tomcat7

There're a bug in plugin
   org.apache.tomcat.maven
   tomcat7-maven-plugin
   2.1
dont read the tag configuration you must put each var in section properties
      
  http://localhost:port/manager/text
  TomcatServer
  ${project.artifactId}
  true
  /${project.build.finalName}
 
and execute goal mvn tomcat:redeploy this work¡

Wednesday, June 5, 2013

integration-test with web server

I want created a integration-test with web server tomcat to launch integration test execute
mvn integration-test -Ptomcat 
to generate war file
mvn package
In a hand i have web server tomcat: to launch integration-test i have a this file pom.xml to start and stop tomcat web service

   tomcat
   
 
      org.codehaus.mojo
      tomcat-maven-plugin
      1.1
      
       true
       true
       /${project.build.finalName}
       ${project.build.directory}/${project.build.finalName}.war
       9876
      
      
       
        start-tomcat
        pre-integration-test
        
         run-war
        
       
       
        stop-tomcat
        post-integration-test
        
         shutdown
        
       
      
     
and the other hand i have the integration test

   
    maven-surefire-plugin
    
     true
    
   
   
    maven-failsafe-plugin
    2.7.2
    
     
      **/*Test.java
     
    
    
     
      integration-test
      integration-test
      
       integration-test
      
     
     
      verify
      verify
      
       verify
      
     
    
   
  
But I have a problem to add resources files. you need add this line in your pom.xml file

     
      src/test/resources
      
       app.properties
      
     
    
and add this line in pom.xml file to erase previous resources files generate with execute integration test

      org.apache.maven.plugins
      maven-clean-plugin
      2.5
      
       
        clean
        generate-resources
        
         clean
        
       
      

Thursday, December 13, 2012

maven: HOW external resource extract from artefactory.jar

I want to extract some resource form artefactory to used in other proyect, we need 2 plugins maven-dependency-plugin to extract and maven-clean-plugin to clean proyect. call first plugin execute the goal dependency:unpack.

   
    org.apache.maven.plugins
    maven-dependency-plugin
    2.6
    
     
      
       ${project.groupId}
       com.company.artefactory
       ${project.version}
       jar
       true
       directoryInsideJar/**/*.*
       src/main/resources
      
     
     
    
   
   
    maven-clean-plugin
    2.5
    
     
      
       src/main/resources/directoryInsideJar/
      
     
    
   

Thursday, November 29, 2012

Repository rejected artifact "due to its snapshot/release handling policy."

I'm a newbie in proxy maven server management. I have a problem with download own artefactory from my maven server. To solver this problem put this in your pom.xml [1]http://forums.jfrog.org/Repository-rejected-artifact-quot-due-to-its-snapshot-release-handling-policy-quot-td6513457.html

  
   ubuntu-releases
   ubuntu-releases
   http://serverMaven:8080/artifactory/libs-release-local
   
    interval:1
   
  
  
   ubuntu-snapshots
   ubuntu-snapshots
   http://serverMaven:8080/artifactory/libs-snapshot-local
   
    false
   
   
    true
    interval:1
   
  
 

Friday, October 19, 2012

cant find parent project

I have a maven project with module and parent proyect. If you launch a test module with command mvn  test this work, but you add a variable inside module that reference to parent proyect. ${project.version} and now launch mvn test, this fail. You must install project parent in your local repository to launch module.

Friday, September 21, 2012

NoClassDefFoundError: org/apache/lucene/util/Version






I make a project with blueprint-neo4j-graph and pellet , but pellet use lucene-core  2.3.1 and blueprint-neo4j-graph use lucene-core 3.5.0

I have a new error  in neo4j to load lucene version

Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/util/Version
    at org.neo4j.index.impl.lucene.LuceneDataSource.<clinit>(LuceneDataSource.java:110)
    at org.neo4j.index.lucene.LuceneIndexProvider.load(LuceneIndexProvider.java:70)
    at org.neo4j.kernel.InternalAbstractGraphDatabase$DefaultKernelExtensionLoader.loadIndexImplementations(InternalAbstractGraphDatabase.java:1191)
    at org.neo4j.kernel.InternalAbstractGraphDatabase$DefaultKernelExtensionLoader.init(InternalAbstractGraphDatabase.java:1163)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:382)
    ... 39 more
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.util.Version
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 44 more



I have pellet dependence
    <dependency>
            <groupId>com.owldl</groupId>
            <artifactId>pellet</artifactId>
            <version>2.3.0</version>
        </dependency>
         <dependency>
            <groupId>com.tinkerpop.blueprints</groupId>
            <artifactId>blueprints-neo4j-graph</artifactId>
            <version>2.1.0</version>
        </dependency>

With plugin m2e resolve depencence add this code in pom.xml project 


    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-core</artifactId>
                <version>3.5.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

Monday, July 23, 2012

Access denied to http://repository.jboss.org


I have an error,

Failure to transfer javax.servlet:servlet-api/maven-metadata.xml from http://repository.jboss.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of jboss-repo has elapsed or updates are forced. Original error: Could not transfer metadata javax.servlet:servlet-api/maven-metadata.xml from/to jboss-repo (http://repository.jboss.org/maven2): Access denied to http://repository.jboss.org/maven2/javax/servlet/servlet-api/maven-metadata.xml. Error code 403, Forbidden

I find this entry
http://stackoverflow.com/questions/1979957/maven-dependency-for-servlet-3-0-api

The proyect maven org.bricked socialauth-spring  have this entry in pom.xml
      <repository>
            <id>jboss-repo</id>
            <url>http://repository.jboss.org/maven2</url>
      </repository>

but I cant solver.

to solver this error

Make this in settings.xml we should add something like:

<mirrors>
    <mirror>
    <id>my-internal-repository</id>
    <name>Mirror of jboss-repo /</name>
    <url>http://repo2.maven.org/maven2/</url>
    <mirrorOf>jboss-repo</mirrorOf>
    </mirror>

</mirrors>