lunes, 15 de abril de 2013

Maven jar autoejecutable - con dependencias - runnable




Solo reemplazar nombre package y mainClass por la que corresponda.

Maven configurar scm y nexus central



    <scm>
        <url>scm:svn:https://Desarrollo/svn/desarrollo/trunk/${project.artifactId}</url>
        <connection>scm:svn:https://Desarrollo/svn/desarrollo/trunk/${project.artifactId}</connection>
        <developerConnection>scm:svn:https://Desarrollo/svn/desarrollo/trunk/${project.artifactId}</developerConnection>
    </scm>

    <distributionManagement>
        <repository>
            <id>nexus</id>
            <name>Internal Releases</name>
            <url>http://192.168.1.100:8081/nexus/content/repositories/releases/</url>
        </repository> -<snapshotRepository>
            <id>nexus</id>
            <name>Internal Snapshots</name>
            <url>http://192.168.1.100:8081/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>


Esto acompañado de la configuración correcta de maven. settings.xml, como por ej:

<settings>
  <servers>
    <server>
      <id>192.168.1.100</id>
      <username>jastorga</username>
      <password>jastorga</password>
    </server>
    <server>
      <id>nexus</id>
      <username>jastorga</username>
      <password>jastorga</password>
    </server>
    <server>
      <id>releases</id>
      <username>jastorga</username>
      <password>jastorga</password>
    </server>
    <server>
      <id>snapshots</id>
      <username>jastorga</username>
      <password>jastorga</password>
    </server>
  </servers>

  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://192.168.1.100:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>