java - Maven won't deploy dependencies -


I have a simple project with 3 dependencies, but for some reason when I ran from Eclipse -> maven install I'm running. I do not get dependency in snapshot jar inside and out ... any thoughts? This is my pom:

   & Lt; Version & gt; 0.0.1-snapshot and lt; / Edition & gt; & Lt; Packaging & gt; Jar & lt; / Packaging & gt; & Lt; Name & gt; Business & lt; / Name & gt; & Lt; URL & gt; Http: //maven.apache.org< / URL & gt; & Lt; Properties & gt; & Lt; Project.build.sourceEncoding & gt; UTF-8 & LT; /project.build.sourceEncoding> & Lt; / Properties & gt; & Lt; Dependency & gt; & Lt; Dependency & gt; & Lt; Group & gt; JUnit & lt; / Group & gt; & Lt; ArtifactId & gt; JUnit & lt; / ArtifactId> & Lt; Version & gt; 3.8.1 & lt; / Edition & gt; & Lt; Scope & gt; Trial & lt; / Scope & gt; & Lt; / Dependencies & gt; & Lt; Dependency & gt; & Lt; Group & gt; Mysql & lt; / Group & gt; & Lt; ArtifactId & gt; Mysql-connector-java & lt; / ArtifactId> & Lt; Version & gt; 5.1.6 & lt; / Edition & gt; & Lt; Scope & gt; Collection & lt; / Scope & gt; & Lt; / Dependencies & gt; & Lt; Dependency & gt; & Lt; Group & gt; Log4j & lt; / Group & gt; & Lt; ArtifactId & gt; Log4j & lt; / ArtifactId> & Lt; Version & gt; 1.2.12 & lt; / Edition & gt; & Lt; Scope & gt; Collection & lt; / Scope & gt; & Lt; / Dependencies & gt; & Lt; / Dependencies & gt; & Lt; / Project & gt;  

(...) I do not get dependencies inside the snapshot jar Is not there any idea?

Yes: this should not be with a jar packaging for a project. The built-in jar "only" includes classes from your project, the dependency is "compiled" and used during test execution.

Introduction to Dependency Mechanism :

Use the Dependency Scope to Limit the Transit of a Divergence It is done, and also to affect the square foot used for various build tasks.

6 scope available:

  • compile
    This default scope, if none has been specified then Compile dependencies in all the squares of a project. In addition, those dependencies are publicized for dependent projects.
  • Provided
    It is very similar to a compilation, but it indicates that you expect JDK or container to provide dependency on runtime. For example, while creating a web application for Java Enterprise Edition, you will determine the reliability of the serlet API and related Java EE API for the claim because the web container provides those sections. This scope is available only on the compilation and testing class, and it is not transitive.
  • Runtime
    This scope indicates that dependency is not required for compilation, but execution. This runtime and test is in classpath, but not compile classpath.
  • Test
    This opportunity indicates that the general use of the application does not require dependence, and is only available for testing compilation and execution stages.
  • System
    This is similar to providing the scope, except that you have to provide a jar which is clearly included in it. Artifact is always available and is not seen in a repository.
  • Import (available only in Maven 2.0.9 or later)
    This scope is used only for a & lt; Dependency Management & gt; Dependency of type palm in the section indicates that the specified POM is & lt; Dependency Management & gt; Dependency in the section should be replaced as they have been replaced, so dependence with a limit of imports does not really involve participating in limiting the transit of reliance.

    ...

    If you want to create a standalone executable jar with dependencies, and pre-defined Jar-K- Consider using the dependency descriptor. Take a look at these past answers:

    Other options include, simple For the use cases, I suggest using the assembly plugin.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -