Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEP includes Maven "test/provided scope" dependencies to the classpath when running development mode #313

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

The issue is copied from GWT Issue 4929 
(https://code.google.com/p/google-web-toolkit/issues/detail?id=4929).

I check it on Eclipse plugin  3.8.0.v201410302155-rel-r44 with GWT 2.6.1 and it 
is actual.

Work around - move tests to separate projects. For me it means ~40 maven 
modules more.

Original issue content is

Found in GWT Release (e.g. 1.5.3, 1.6 RC):

GWT 2.0.3
Google Plugin for Eclipse 3.5 1.3.2.v201003242055

Encountered on OS / Browser (e.g. WinXP, IE6-7, FF3):

Windows XP
Eclipse 3.5.2
Maven Integration for Eclipse 0.10.0.20100209-0800

Detailed description (please be as specific as possible):

I have a project in Eclipse structured like a standard Maven web project, 
with sources in src/main/java and web files in src/main/webapp. 

When I run this project using the GEP Launcher "Run As > Web application", 
the java process contains the dependencies (from the pom.xml) marked with 
scope "test" and with the scope "provided" in the classpath.

I expected (as explained here 
https://docs.sonatype.org/display/M2ECLIPSE/Runtime+classpath) to have only 
runtime dependencies in the classpath.

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

The pom.xml is the following :

{{{
<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:// 
www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd"> 

  <modelVersion>4.0.0</modelVersion> 

  <groupId>org.test</groupId> 
  <artifactId>gwt-sample</artifactId> 
  <version>1.0.0-SNAPSHOT</version> 

  <packaging>war</packaging> 

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

    <gwt.version>2.0.3</gwt.version> 
  </properties> 

  <dependencies> 

    <dependency> 
      <groupId>com.google.gwt</groupId> 
      <artifactId>gwt-user</artifactId> 
      <version>${gwt.version}</version> 
      <scope>provided</scope> 
    </dependency> 

    <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.8.1</version> 
      <scope>test</scope> 
    </dependency> 

  </dependencies> 

  <build> 
    <plugins> 

      <plugin> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <configuration> 
          <source>${maven.compiler.source}</source> 
          <target>${maven.compiler.target}</target> 
          <optimize>true</optimize> 
          <showWarnings>true</showWarnings> 
          <showDeprecation>true</showDeprecation> 
        </configuration> 
      </plugin> 

      <plugin> 
        <groupId>org.codehaus.mojo</groupId> 
        <artifactId>gwt-maven-plugin</artifactId> 
        <executions> 
          <execution> 
            <goals> 
              <goal>clean</goal> 
              <goal>compile</goal> 
              <goal>test</goal> 
            </goals> 
          </execution> 
        </executions> 
      </plugin> 

    </plugins> 

  </build> 

</project> 
}}}

The command line of the java process :

{{{
D:\devel\tools\win32\jdk-1.6.0_18\bin\javaw.exe 
-Xmx512m 
-Dfile.encoding=UTF-8 
-classpath 
D:\devel\sources\base\gwt\gwt-sample\src\main\java; 
D:\devel\sources\base\gwt\gwt-sample\target\classes; 
D:\devel\local-repository\com\google\gwt\gwt-user\2.0.3\gwt- 
user-2.0.3.jar; 
D:\devel\local-repository\junit\junit\4.8.1\junit-4.8.1.jar; 
D:\devel\tools\win32\eclipse-jee-galileo-SR1-win32\plugins 
\com.google.gwt.eclipse.sdkbundle. 
2.0.3_2.0.3.v201002191036\gwt-2.0.3\gwt-user.jar; 
D:\devel\tools\win32\eclipse-jee-galileo-SR1-win32\plugins 
\com.google.gwt.eclipse.sdkbundle. 
2.0.3_2.0.3.v201002191036\gwt-2.0.3\gwt-dev.jar 
com.google.gwt.dev.DevMode 
-war D:\devel\sources\base\gwt\gwt-sample\target\gwt-sample-1.0.0- 
SNAPSHOT 
-remoteUI 3168:274053652797451 
-startupUrl application.html 
-logLevel INFO 
-port 8888 
org.test.gwt.Application 
}}}

The *expected* command line of the java process :

{{{
D:\devel\tools\win32\jdk-1.6.0_18\bin\javaw.exe 
-Xmx512m 
-Dfile.encoding=UTF-8 
-classpath 
D:\devel\sources\base\gwt\gwt-sample\src\main\java; 
D:\devel\sources\base\gwt\gwt-sample\target\classes; 
D:\devel\tools\win32\eclipse-jee-galileo-SR1-win32\plugins 
\com.google.gwt.eclipse.sdkbundle. 
2.0.3_2.0.3.v201002191036\gwt-2.0.3\gwt-user.jar; 
D:\devel\tools\win32\eclipse-jee-galileo-SR1-win32\plugins 
\com.google.gwt.eclipse.sdkbundle. 
2.0.3_2.0.3.v201002191036\gwt-2.0.3\gwt-dev.jar 
com.google.gwt.dev.DevMode 
-war D:\devel\sources\base\gwt\gwt-sample\target\gwt-sample-1.0.0- 
SNAPSHOT 
-remoteUI 3168:274053652797451 
-startupUrl application.html 
-logLevel INFO 
-port 8888 
org.test.gwt.Application 
}}}

Workaround if you have one:

None found...

Original issue reported on code.google.com by [email protected] on 8 Nov 2014 at 4:38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant