I read in my morning mail that you were told how to fix this.
import com.huawei.cona.android.jmdns-new;
The compiler is not even looking at your maven dependencies.
It is telling you that you have a syntax error. jmdns-new is not a legal syntax
for a class name in an import statement since it is missing the package part of
the class name.
It can not even figure out what you want to import so it does not care what you
have as dependencies in Maven.
Follow Barrie's advice and read up on Java packages.
http://en.wikipedia.org/wiki/Java_package is a start.
Once you have a line without a syntax error, you will get into Maven.
Barrie's advice about reading up on Maven to understand dependencies and the
structure of the GAV (GroupId, ArtifactId, Version)
<dependency>
<groupId>com.huawei.cona.android</groupId>
<artifactId>jmdns-new</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
or
<dependency>
<groupId>com.huawei.cona</groupId>
<artifactId>android-jmdns-new</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
Ron
On 11/04/2012 6:52 PM, mike digioia wrote:
Hi Barrie,
Sorry to take anymore of your time up. But I have not had any success with
all the changes I have made to correct this problem. Based on your
recommendation I suspect it is a mismatch in what I have in my code and in
my pom/environment. I used mvn install to add jar files that I created
manually (Old one was changed today to this in an attempt to correct it)
Like this-
conalab@ching-jen-laptop:~/.m2/repository/com/huawei/cona/android/zeroconf/jmdns/1.0$
mvn install:install-file -Dfile=src.jmdns.jar -Dsources=src.jmdns.jar
-DgroupId=src.jmdns -DartifactId=jmdns -Dversion=new -Dpackaging=jar
-DgeneratePom=true
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO]
------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [install:install-file] (aggregator-style)
[INFO]
------------------------------------------------------------------------
[INFO] [install:install-file {execution: default-cli}]
[INFO] Installing
/home/conalab/.m2/repository/com/huawei/cona/android/zeroconf/jmdns/1.0/src.jmdns.jar
to /home/conalab/.m2/repository/src/jmdns/jmdns/new/jmdns-new.jar
[INFO] Installing
/home/conalab/.m2/repository/com/huawei/cona/android/zeroconf/jmdns/1.0/src.jmdns.jar
to /home/conalab/.m2/repository/src/jmdns/jmdns/new/jmdns-new-sources.jar
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time:< 1 second
[INFO] Finished at: Wed Apr 11 14:10:43 PDT 2012
[INFO] Final Memory: 4M/80M
[INFO]
------------------------------------------------------------------------
*********************************
As you can see this created new jar/pom files in my local repository. Then
I also changed the source file using these new jars. The main issue that
seem to cause my problem before was the use of "jmdns-1.0.jar" where the
1.0 in the name did not seem to be recommended in the write up about syntax
used for packages in java. So this time I don't have any numbers. But I do
have "jmdns-new.tar" for my new jar. The local (in repository) pom gets
automatically created as this-
<groupId>src.service</groupId>
<artifactId>service</artifactId>
<version>new</version>
<description>POM was created from install:install-file</description>
****************************
I also added this to my project pom (did same thing last time) as this -
</dependency>
<dependency>
<groupId>src.service</groupId>
<artifactId>service</artifactId>
<version>new</version>
<scope>system</scope>
<systemPath>/home/conalab/.m2/repository/src/service/service/new/service-new.jar</systemPath>
****************************
But in the code I have attempted to import them without any success and get
the same dumb error messages. Here is the source file section -
package com.huawei.cona.android.zeroconf;
import java.io.IOException;
import jmdns-new;
import service-new;
import service.ServiceEvent;
import service.ServiceInfo;
import service.ServiceListener;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
********************************
Error messages seem to complain about the "-new" now instead of the 1.0
like last time.
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
/home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/com/huawei/cona/android/zeroconf/ServiceDiscovery.java:[5,12]
'.' expected
/home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/com/huawei/cona/android/zeroconf/ServiceDiscovery.java:[5,13]
';' expected
/home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/com/huawei/cona/android/zeroconf/ServiceDiscovery.java:[6,14]
'.' expected
/home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/com/huawei/cona/android/zeroconf/ServiceDiscovery.java:[6,15]
';' expected
**************************************
So I have attempted to change the way the two import statement are but
nothing makes it work.
Do you (or anyone else) see something basic that is still not correct?
By the way. nothing like this should take this long to fix without
suspecting the basic system is just broken, since not enough information is
know about the internals of Maven. The manual has not helped. Not enough
time to study the code.
/mpd
On Wed, Apr 11, 2012 at 12:28 AM, Barrie Treloar<baerr...@gmail.com> wrote:
On Wed, Apr 11, 2012 at 4:45 PM, mike digioia<mpd...@gmail.com> wrote:
Can anyone in the world tell me what line number and what error this
compiler thinks my error is in source file ServiceDiscovery.java?
/home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/com/huawei/cona/android/zeroconf/ServiceDiscovery.java:[5,12]
'.' expected
Line 5, Column 12.
/home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/com/huawei/cona/android/zeroconf/ServiceDiscovery.java:[5,13]
';' expected
Line 5, Column 13.
/home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/com/huawei/cona/android/zeroconf/ServiceDiscovery.java:[6,14]
'.' expected
Line 6, Column 14.
/home/conalab/MikesNewAndroidWork/workspace3/jxwhiteboard_ccn_gohuawei_dist/trunk/src/com/huawei/cona/android/zeroconf/ServiceDiscovery.java:[6,15]
';' expected
Line 6, Column 15.
The errors are telling you its expecting a .
I suspect you have your imports defined incorrectly.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org
--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org