0
votes

I download a jar to my local reposotory but every times i compile netbeans try to download it why can be this happen i try to change dependecy scope but i couldnt figure out a solution.This is my dependency i also try provided ,runtime... jregex jregex 1.2_01 compile

Netbeans output as below and i use netbeans suggested maven command to store manualy downloaded jregex jar to my local repository and i also have other dependend jars instaled and stored my local repository .

[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! Copying 3 resources Downloading: http://repository.jboss.org/maven2//jregex/jregex/1.2_01/jregex-1.2_01.pom Unable to find resource 'jregex:jregex:pom:1.2_01' in repository repository.jboss.org (http://repository.jboss.org/maven2/) Downloading: http://download.java.net/maven/2//jregex/jregex/1.2_01/jregex-1.2_01.pom Unable to find resource 'jregex:jregex:pom:1.2_01' in repository java.net (http://download.java.net/maven/2/) Downloading: http://repo1.maven.org/maven2/jregex/jregex/1.2_01/jregex-1.2_01.pom Unable to find resource 'jregex:jregex:pom:1.2_01' in repository central (http://repo1.maven.org/maven2)

3

3 Answers

2
votes

cd to the directory containing your jregex-1.2_01.jar file and run the following:

mvn install:install-file -DgroupId=jregex -DartifactId=jregex -Dversion=1.2_01 -Dpackaging=jar -Dfile=jregex-1.2_01.jar

That will install the jar in your local repository as indicated by the dependency you wrote, which is (if I understood correctly):

    <dependency>
        <groupId>jregex</groupId>
        <artifactId>jregex</artifactId>
        <version>1.2_01</version>
    </dependency>

If you want to get rid of the warning, you can also add

 <build>
     <plugins>
         <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-resources-plugin</artifactId>
             <configuration>
                 <encoding>UTF-8</encoding>
             </configuration>
         </plugin>
         // ...
     </plugins>
     // ...
</build>

update: check that the POM itself (jregex-1.2_01.pom) is really on your local repository. Maybe this is obvious and you already did it but I'm out of ideas :) For some reason it could be that the jar is found there, but the pom is not. If this is not the case, you have some kind of mismatch between the local repository when maven runs and when you install the jar from console, but I can't figure out how.

0
votes
  • Your dependency may be in a wrong directory
  • Your "settings.xml" file may point to a local path where the dependency doesn't exist.

You should post an extract from your pom.xml, settings.xml and the path to the dependency if you want further explanations...

0
votes

or your dependency doesn't have a pom file in the remote repository and maven re-attempts to download it.

please try with recently released nb 7.0, it has the uptodate maven 3.x binaries embedded.