Wednesday, March 29, 2017

Re: How to deal with transitive maven dependencies?

Are you sure postgres library group/artifactid/version is ok? Chek at https://mvnrepository.com/artifact/postgresql/postgresql 

On Wed, 29 Mar 2017 at 14:15 Magnus <alpineblaster@gmail.com> wrote:
I have everything in the dependency section.

Here are the complete pom files.
Note that "mylib" is "msm-lib-acs" and "myapp" is "msm-app-mcs" (I am still struggeling with the Maven naming conventions.):

mylib aka msm-lib-acs, pom.xml:

  <modelVersion>4.0.0</modelVersion>
  <groupId>msm.lib.acs</groupId>
  <artifactId>msm-lib-acs</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>msm-lib-acs</name>

  <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <maven.compiler.source>1.8</maven.compiler.source>
   <maven.compiler.target>1.8</maven.compiler.target>
  </properties>


  <dependencies>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>

<!--
      <scope>test</scope>
-->
    </dependency>

    <dependency>
     <groupId>javax.mail</groupId>
     <artifactId>javax.mail-api</artifactId>
     <version>1.5.6</version>
    </dependency>

    <dependency>
     <groupId>javax.servlet</groupId>
     <artifactId>javax.servlet-api</artifactId>
     <version>3.1.0</version>
    </dependency>

    <dependency>
     <groupId>com.google.gwt</groupId>
     <artifactId>gwt-user</artifactId>
     <version>2.8.0</version>
     <scope>provided</scope>
    </dependency>

   <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>6.0.6</version>
   </dependency>
   
   <dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.0.0</version>
   </dependency>


  </dependencies>

<build>
  <resources>
    <resource>
      <directory>src/main/resources</directory>
    </resource>
    <resource>
      <directory>src/main/java</directory>
      <includes>
        <include>msm/lib/acs/awi/**/*.java</include>
        <include>msm/lib/acs/**/*.gwt.xml</include>
        <include>msm/lib/acs/awi/**/*.css</include>
        <include>msm/lib/acs/awi/**/*.png</include>
      </includes>
    </resource>
  </resources>
</build>
</project>


myapp aka msm-app-mcs, pom.xml:

<?xml version="1.0" encoding="UTF-8"?>

  <!-- POM file generated with GWT webAppCreator -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>msm.app.mcs</groupId>
  <artifactId>msm-app-mcs</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>msm.app.mcs.Application</name>

  <properties>

    <!-- Setting maven.compiler.source to something different to 1.8
         needs that you configure the sourceLevel in gwt-maven-plugin since
         GWT compiler 2.8 requires 1.8 (see gwt-maven-plugin block below) -->
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

    <!-- Don't let your Mac use a crazy non-standard encoding -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- ensure all GWT deps use the same version (unless overridden) -->
      <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt</artifactId>
        <version>2.8.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>msm.lib.acs</groupId>
      <artifactId>msm-lib-acs</artifactId>
      <version>1.0-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
    
  </dependencies>

  <build>
    <!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes" update them in DevMode -->
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>

    <plugins>

      <!-- GWT Maven Plugin-->
      <plugin>
        <groupId>net.ltgt.gwt.maven</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.0-rc-6</version>
        <executions>
          <execution>
            <goals>
              <goal>import-sources</goal>
              <goal>compile</goal>
              <goal>import-test-sources</goal>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <moduleName>msm.app.mcs.Application</moduleName>
          <moduleShortName>Application</moduleShortName>
          <failOnError>true</failOnError>
          <!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you use
               a different source language for java compilation -->
          <sourceLevel>1.8</sourceLevel>
          <!-- Compiler configuration -->
          <compilerArgs>
            <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
            <arg>-compileReport</arg>
            <arg>-XcompilerMetrics</arg>
          </compilerArgs>
          <!-- DevMode configuration -->
          <warDir>${project.build.directory}/${project.build.finalName}</warDir>
          <classpathScope>compile+runtime</classpathScope>
          <!-- URL(s) that should be opened by DevMode (gwt:devmode). -->
          <startupUrls>
            <startupUrl>Application.html</startupUrl>
          </startupUrls>
        </configuration>
      </plugin>

      <!-- Skip normal test execution, we use gwt:test instead -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>

    </plugins>
  </build>
</project>

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment