I am attempting to release a Mule domain using the mule-domain-maven-plugin. I've noticed when invoking install, that the main *.zip artifact is installed, followed by the *.pom, followed by a second copy of the *.zip:
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # esb-common ---
[INFO] Installing /Users/chase/git/dn2k/dn2k-esb/esb-common/target/esb-common-2.6.7.0.zip to /Users/chase/.m2/repository/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip
[INFO] Installing /Users/chase/git/dn2k/dn2k-esb/esb-common/pom.xml to /Users/chase/.m2/repository/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.pom
[INFO] Installing /Users/chase/git/dn2k/dn2k-esb/esb-common/target/esb-common-2.6.7.0.zip to /Users/chase/.m2/repository/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip
A bit odd, perhaps, but harmless.
However, when attempting to release, a similar sequence is followed. First the main *.zip artifact is uploaded to Nexus, then the *.pom, then maven-metadata.xml, then finally a second copy of the main *.zip artifact:
[INFO] Uploading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip
[INFO] Uploaded: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip (2 KB at 7.7 KB/sec)
[INFO] Uploading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.pom
[INFO] Uploaded: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.pom (2 KB at 6.7 KB/sec)
[INFO] Downloading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/maven-metadata.xml
[DEBUG] Could not find metadata com.dn2k:esb-common/maven-metadata.xml in dn2k-deployment (http://<hostname>/nexus/content/repositories/releases/)
[DEBUG] Writing tracking file /Users/myron/.m2/repository/com/dn2k/esb-common/resolver-status.properties
[INFO] Uploading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/maven-metadata.xml
[INFO] Uploaded: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/maven-metadata.xml (302 B at 1.4 KB/sec)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://<hostname>/nexus/content/repositories/releases/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://<hostname>/nexus/content/repositories/releases/ with username=admin, password=***
[INFO] Uploading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip
^^^^ ERRORS OUT ^^^^
On this second upload, Nexus balks, as we have it configured to disallow multiple uploads of the same released artifact.
In the source code for the plugin, line 88 identifies the zip file as the main artifact, and just one line above identifies that same file as an attachment. This double identification is what causes the maven-install-plugin to do the double copy to the ~/.m2/repository as shown above.
Is this a bug, or am I failing to configure the plugin correctly? Does anyone have an example of a successful release using the mule-domain-maven-plugin?
Here's the pom for the esb-common (domain) project (version managed to 1.1 for the plugin):
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dn2k</groupId>
<artifactId>esb-common</artifactId>
<packaging>mule-domain</packaging>
<parent>
<groupId>com.dn2k</groupId>
<artifactId>esb-parent</artifactId>
<version>2.6.7.0</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-domain-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
I filed a case for mulesoft team. They now fixed my ticket. This was clearly a bug. Luckily I doesn't get these redudant installing message anymore, if I use the latest mule version and mule plugin.
[INFO] Installing C:\project\workspaces\workspace_mule\zzzz\pom.xml to C:\Users\charmin\.m2\repository\com\mycompany\zzzz\1.0.0-SNAPSHOT\zzzz-1.0.0-SNAPSHOT.pom
[INFO] Installing C:\project\workspaces\workspace_mule\zzzz\target\zzzz-1.0.0-SNAPSHOT.zip to C:\Users\charmin\.m2\repository\com\mycompany\zzzz\1.0.0-SNAPSHOT\zzzz-1.0.0-SNAPSHOT.zip
Related
have been developing a java app being compiling and built with Maven.
Trying to deploy it on tomcat server.
to deploy I added the next plugin-section to pom.xml :
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<server>maven-tomcat-war-deployment-server</server>
<url>http://localhost:8080/manager/text</url>
<path>/rps</path>
</configuration>
</plugin>
and also had had before the section
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
and it is able to deploy my "testapp" onto tomcat server with
command line:
$ mvn install tomcat7:deploy
in this case everything will be ok
BUT from IntelliJ my tries are unsuccessful. I have the next failure:
[INFO] --- tomcat7-maven-plugin:2.0:deploy (default-cli) # testapp
--- [INFO] Deploying war to http://localhost:8080/rps Uploading: http://localhost:8080/manager/text/deploy?path=%2Frps Uploaded:
http://localhost:8080/manager/text/deploy?path=%2Frps (11 KB at 1053.5
KB/sec)
Uploading: http://localhost:8080/manager/text/deploy?path=%2Frps
Uploaded: http://localhost:8080/manager/text/deploy?path=%2Frps (11 KB
at 2107.0 KB/sec)
tomcatManager status code:401, ReasonPhrase: [INFO] [INFO] [INFO]
[INFO] 401 Unauthorized [INFO] <etc..> [INFO]
[INFO] 401 Unauthorized [INFO] [INFO]
**You are not authorized to view this page. If you have not changed [INFO] any configuration files, please examine the file [INFO]
conf/tomcat-users.xml in your installation. That [INFO]
file must contain the credentials to let you use this webapp. [INFO]
For example, to add the manager-gui role to a user named
[INFO] tomcat with a password of s3cret, add the
following to the [INFO] config file listed above.**
Everything is clear but have no idea where in IntelliJ I can assign admin-user name and password in order to get access to tomcat?
Obviously, I have admin-user-role credentials entries in maven/settings.xml :
<server>
<id>maven-tomcat-war-deployment-server</id>
<username>admin</username>
<password>admin</password>
</server>
and correspondingly in tomcat/conf/tomcat-users.xml have:
<tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0">
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-script,manager-jmx,manager-gui"/>
PS To run it this way I changed run configuration to execute command like with it was
with command line: install tomcat7:deploy -f pom.xml
in case when I try to configure a new run-configuration based on TomCat Server there will happen much more serious and unpredictable problems which should as i think be described in a separate question.
Couldn't imagine it would be such a tremendous problem to deploy an existing app on tomcat)
There are on youtube a video from JetBrain how to do that but without any connection
to developing within Maven-framework concept.
TYA
Sergei
I have a toy program that has a compilation error only in Eclipse when I try to use a Chronicle import and compile to language level 11. The program compiles and runs in maven, and also in IntelliJ (with the same maven and JDK).
The versions I have are:
maven 3.6.1
jdk openjdk version "11" 2018-09-25
eclipse 2020-03-R
chronicle-bom 2.19.199 (supported java11 since 2.17)
This is my pom.xml
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>testjava11</groupId>
<artifactId>chronicle-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-bom</artifactId>
<version>2.19.199</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-map</artifactId>
</dependency>
</dependencies>
</project>
And here is my simple test class:
import net.openhft.chronicle.bytes.BytesMarshallable;
public class App {
public static void main(String[] args) {
System.out.println("BytesMarshallable: " + new BytesMarshallable() {});
}
}
The output when running exec:java directly with maven is
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< testjava11:chronicle-test >----------------------
[INFO] Building chronicle-test 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # chronicle-test ---
[INFO] Deleting C:\Users\eclipse-workspace\chronicle-test\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # chronicle-test ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # chronicle-test ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\eclipse-workspace\chronicle-test\target\classes
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) # chronicle-test ---
BytesMarshallable: App$1#309d6b5b
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.400 s
[INFO] Finished at: 2020-06-11T15:04:53+02:00
[INFO] ------------------------------------------------------------------------
It compiles in IntelliJ and this is the output when I run as a Java Application:
BytesMarshallable: App$1#39fb3ab6
Process finished with exit code 0
However, in Eclipse the class App will not compile. The error is on the import line and says:
The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
There is an additional message in the Problems panel:
The project was not built since its build path is incomplete.
Cannot find the class file for java.lang.String.
Fix the build path then try building this project
But I don't see what the issue is in my build path:
Furthermore, I can see java.lang is present in the package explorer:
(Note that if I change the language level to 8, but still using JDK 11, it will work in Eclipse.)
I have checked for obvious issues (build path, maven/jdk path) and everything appears correct to me. Why do I get this error in Eclipse and how can I fix it?
The full error message is :
Type java.lang.String is indirectly referenced from required .class files but cannot be resolved since the declaring package java.lang exported
from module java.base conflicts with a package accessible from module
It's caused by one of the transitive dependencies, net.openhft:affinity:3.2.3, embedding 2 classes from the java.lang package, which is illegal. The ECJ compiler in Eclipse complaining about it is expected. However, the fact it works in javac is a bug in itself: https://bugs.openjdk.java.net/browse/JDK-8215739
There's an affinity issue about it: https://github.com/OpenHFT/Java-Thread-Affinity/issues/58
If you're not using the thread affinity features, just exclude affinity from your dependencies and the Eclipse compiler will stop complaining.
The error was solved after I opened
Window > Preferences: Java > Installed JREs > Execution Env
And re-selected the JavaSE-11, Apply and Close
In my case I had following error, and it had no relationship with "Configure build path" --
The type java.io.FilterOutputStream cannot be resolved. It is indirectly referenced from required .class files
The error was solved after I create a package and located the problematic class into the class.
It has a mismatch with pom file so update in pom file as well.
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
I have used these two then its working fine for me.
Since Maven 3.2.2 supports defining the pom's parent version with ranges, is it possible to configure m2e plugin to resolve the version range? How?
Edit 1: (2014-09-29 # 09:50 AEST)
Scenario: Importing a maven project with the following parent definition into eclipse with m2e plugin (the project is not a module of its parent)
<parent>
<artifactId>artifactId</artifactId>
<groupId>groupId</groupId>
<version>[1.0,1.1)</version>
</parent>
M2E plugin fails to resolve the version range, showing this error message in the POM editor:
Could not transfer artifact groupId:artifactId:pom:[1.0,1.1) from/to nexus-releases (http://nexus.proxy/content/groups/public/): Illegal character in path at index 82: http://nexus.proxy/content/groups/public/groupId/artifactId/[1.0,1.1)/artifactId-[1.0,1.1).pom and 'parent.relativePath' points at wrong local POM
It works when running with Run as... > Maven install, see the log snippet below:
[INFO] Scanning for projects...
[INFO] Downloading: http://nexus.proxy/content/groups/public/groupId/artifactId/maven-metadata.xml
[INFO] Downloading: http://nexus.proxy/content/groups/public/groupId/artifactId/maven-metadata.xml
[INFO] Downloading: http://nexus.proxy/content/groups/public-snapshot/groupId/artifactId/maven-metadata.xml
[INFO] Downloaded: http://nexus.proxy/content/groups/public-snapshot/groupId/artifactId/maven-metadata.xml (488 B at 0.8 KB/sec)
[INFO] Downloaded: http://nexus.proxy/content/groups/public/groupId/artifactId/maven-metadata.xml (2 KB at 2.1 KB/sec)
[INFO] Downloaded: http://nexus.proxy/content/groups/public/groupId/artifactId/maven-metadata.xml (2 KB at 2.1 KB/sec)
[INFO] Downloading: http://nexus.proxy/content/groups/public/groupId/artifactId/[1.0,1.1)/artifactId-[1.0,1.1).pom
[INFO] Downloading: http://nexus.proxy/content/groups/public/groupId/artifactId/[1.0,1.1)/artifactId-[1.0,1.1).pom
PS.: The question is not whether or not this is a good practice, please refer to Benjamin's comment for some background.
Related to How to configure maven or eclipse in order to use the RELEASE constant within versions?
Should be fixed on m2e v1.6.x
Bugzilla for M2E #445883 (duplicated of #438441)
As a workaround, using LATEST or RELEASE as parent pom's version should work.
I'm trying to follow the get started manual of maven, but I receive this error
c:\Ambiente\workspace>mvn archetype:generate \ -DarchetypeGroupId=org.apache.maven.archety
pes \ -DgroupId=com.mycompany.app \ -DartifactId=my-app -X
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-27 23:15:32-0300)
Maven home: C:\Ambiente\apache-maven-3.1.0
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_25\jre
Default locale: pt_BR, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\Ambiente\apache-maven-3.1.0\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\t316360\.m2\settings.xml
[DEBUG] Using local repository at C:\Users\t316360\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\Users\t3163
60\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent
: null]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.078s
[INFO] Finished at: Mon Jul 22 17:23:03 BRT 2013
[INFO] Final Memory: 11M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this d
irectory (c:\Ambiente\workspace). Please verify you invoked Maven from the correct directo
ry. -> [Help 1]
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a proj
ect to execute but there is no POM in this directory (c:\Ambiente\workspace). Please verif
y you invoked Maven from the correct directory.
what is POM and what do I suppose to do to have this file?
A pom.xml file describes how to build a project. It can be considered the Java version of a Makefile in C/C++ or setup.py in Python. Are you following a specific example?
The pom.xml file is the core of a project's configuration in Maven. It is a single configuration file that contains the majority of information required to build a project in just the way you want. The POM is huge and can be daunting in its complexity, but it is not necessary to understand all of the intricacies just yet to use it effectively.
Below is just a simple example:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Maven Quick Start Archetype</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
To build the dependencies that you specified in pom.xml file execute:
mvn clean package
After a successfull mvn package you will see something like below:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Jul 23 (Time..)
[INFO] Final Memory: 3M/6M
[INFO] -----------------------------
the above command will download all the dependencies to your home directory /home/user/.m2/..
Have a look on this How to create a maven project
Also have a look to Maven in 5 min
The way you tried the command is supposed to work for Linux environment and you are running Windows. Please double check the command (likely removing the \ ) and it should work just fine.
I have a maven-based GWT project that includes Guava. I am running into trouble with Maven trying (and failing) to compile the sources that it finds in guava-gwt*.jar:
could not parse error message: symbol: static setCountImpl
location: class
/home/mark/.m2/repository/com/google/guava/guava-gwt/11.0.1/guava-gwt-11.0.1.jar(com/google/common/collect/AbstractMultiset.java):100: error: cannot find symbol
return setCountImpl(this, element, count);
^
I can't figure out why Maven thinks it needs to compile the sources in guava-gwt. Here's what my project looks like:
├── pom.xml
└── src
├── main
│ └── java
└── test
└── java
└── SomeTestFile.java
SomeTestFile.java
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import org.junit.Test;
public class SomeTestFile {
#Test
public void testMethod() {
Multimap<Integer, String> someMap = ArrayListMultimap.create();
someMap.put(5, "five");
System.out.println(someMap);
}
}
pom.xml
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>guava-problem</groupId>
<artifactId>guava-problem</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>11.0.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>11.0.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
I have already tried the following:
Removing the guava dependency (leaving only guava-gwt)
Scoping guava-gwt to provided
I'm not sure what else to try. guava-gwt includes sources because GWT will compile it into equivalent Javascript. But I don't want Maven to try to compile these sources.
Edit
Just a note...the test files themselves have no real need for guava-gwt over guava since they are compiled and run as Java code (they don't go through the GWT compile step). I don't need guava-gwt specifically for these tests but it needs to be available for my actual GWT client code.
Full Maven Output
mark#mark-peters:~/devel/guava-problem$ mvn -V clean test-compile
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.7.0
Java home: /usr/lib/jvm/jdk1.7.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-38-generic" arch: "amd64" Family: "unix"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - guava-problem:guava-problem:jar:1.0
[INFO] task-segment: [clean, test-compile]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: /home/mark/devel/guava-problem/target (included: [**], excluded: [])
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/mark/devel/guava-problem/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/mark/devel/guava-problem/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 1 source file to /home/mark/devel/guava-problem/target/test-classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/home/mark/.m2/repository/com/google/guava/guava-gwt/11.0.1/guava-gwt-11.0.1.jar(com/google/common/collect/AbstractMultiset.java):[19,0] error: cannot find symbol
could not parse error message: symbol: static setCountImpl
location: class
/home/mark/.m2/repository/com/google/guava/guava-gwt/11.0.1/guava-gwt-11.0.1.jar(com/google/common/collect/AbstractMultiset.java):100: error: cannot find symbol
return setCountImpl(this, element, count);
^
could not parse error message: symbol: method setCountImpl(AbstractMultiset<E>,E,int)
location: class AbstractMultiset<E>
where E is a type-variable:
E extends Object declared in class AbstractMultiset
/home/mark/.m2/repository/com/google/guava/guava-gwt/11.0.1/guava-gwt-11.0.1.jar(com/google/common/collect/AbstractMultiset.java):105: error: cannot find symbol
return setCountImpl(this, element, oldCount, newCount);
^
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Feb 21 12:49:42 EST 2012
[INFO] Final Memory: 18M/212M
[INFO] ------------------------------------------------------------------------
Edit (again)
Having found that the source of the problem has nothing to do with Guava but rather the Maven version (see my answer), I've updated the title and question to try to be a lot more helpful to future users.
tl;dr
Maven 2 and JDK 7 are incompatible, as Maven tries to parse javac output which has changed in JDK 7.
Full explanation
Raghuram's note that this worked for him in Maven 3+ took me down the road of exploring this not as a config problem but as an actual Maven problem. I started doing more testing and found that this problem:
Occurs with Java 7 and Maven 2.2.1
Does not occur with Java 7 and Maven 3+
Does not occur with Java 6 and Maven 2.2.1
So at that point it became clear to me that the "could not parse error message" errors were relevant, and the problem probably had less to do with the guava-gwt compilation occurring and more to do with Maven not knowing how to handle the errors properly.
To test this I created a separate Maven project that has nothing to do with Guava:
├── pom.xml
└── src
└── main
└── java
└── ClassWithWarnings.java
pom.xml
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>maven-problem</groupId>
<artifactId>maven-problem</artifactId>
<version>1.0</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build>
</project>
ClassWithWarnings.java
public class ClassWithWarnings implements java.io.Serializable {}
Lo and behold, Maven tanks on this project as well when using Java 7:
mark#mark-peters:~/devel/maven-problem$ mvn -V compile
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.7.0
Java home: /usr/lib/jvm/jdk1.7.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-38-generic" arch: "amd64" Family: "unix"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - maven-problem:maven-problem:jar:1.0
[INFO] task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/mark/devel/maven-problem/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to /home/mark/devel/maven-problem/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
could not parse error message: warning: [options] bootstrap class path not set in conjunction with -source 1.3
/home/mark/devel/maven-problem/src/main/java/ClassWithWarnings.java:1: warning: [serial] serializable class ClassWithWarnings has no definition of serialVersionUID
public class ClassWithWarnings implements java.io.Serializable {}
^
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Feb 21 13:10:47 EST 2012
[INFO] Final Memory: 14M/150M
[INFO] ------------------------------------------------------------------------
With Java 6, it still reports the warnings, but can parse the Javac output and so doesn't tank:
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-38-generic" arch: "amd64" Family: "unix"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - maven-problem:maven-problem:jar:1.0
[INFO] task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/mark/devel/maven-problem/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to /home/mark/devel/maven-problem/target/classes
[WARNING] /home/mark/devel/maven-problem/src/main/java/ClassWithWarnings.java:[1,7] [serial] serializable class ClassWithWarnings has no definition of serialVersionUID
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Feb 21 13:18:39 EST 2012
[INFO] Final Memory: 9M/150M
[INFO] ------------------------------------------------------------------------
So it seems as if the problem was that the latest Maven 2 release doesn't know how to parse error messages from Java 7+ javac. Maven 3 does. I still haven't found documentation of this and am a little surprised that Maven doesn't give a warning when it tries to compile against a JDK version that it doesn't know how to support properly.
Converting my comment to an answer...
The exact pom file along with the test class above compiles fine on my Windows box with maven 3.0.4.
The problem could be with the maven version that you are using. Or there could be other maven goals in the actual pom, which may be causing an issue.
For a similar problem I upgraded maven-compiler-plugin to a later version.
Happened to us, that we received the exact same failure, but with gradle instead of maven. After switching from ArrayListMultimap to LinkedListMultimap to error is gone. So it seems, that in version 11.0.2 at least the ArrayListMultimap is broken.
It appears that it's not trying to compile the Guava libraries, but without the full maven build log we can't tell.
Judging by the information you've posted so far, it would appear instead that you have two incompatible versions of a class or library on your classpath during compilation.
I'm going to try your test project and see if I can give you more information.
EDIT:
So I've found a couple of interesting things. First, I was able to get your project to work without a whole lot of fanfare :(
I changed your pom to:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>11.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>11.0.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
By default though, your test file will not run. I refactored it so it was is now named SomeTestFileTest which will actually run the test.
I'm running Maven v2.2.1 on OSX. I also cleaned out my ~/.m2/repository before starting. I suggest you try the same: nuke your local repository folder and retry your build. If that doesn't work, let me know what version of maven you're running.