You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by mike digioia <mp...@gmail.com> on 2012/04/11 09:15:24 UTC

maven compile error message format

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

/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

Re: maven compile error message format

Posted by Ron Wheeler <rw...@artifact-software.com>.
At least, I got the "Wayne is right" part correct.

Ron

On 12/04/2012 11:28 AM, Wayne Fay wrote:
>> Putting the sources in a executable jar just makes it bigger and slower to
>> load at run--time with absolutely no benefit to the execution.
>>
>> Wayne is right that it will not break anything but why do it.
> Actually that is the scary thing... it CAN break things. Go read that
> old Maven Users email from early 2010 that I linked to.
>
> This is definitely an anti-pattern IMO.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: maven compile error message format

Posted by Wayne Fay <wa...@gmail.com>.
> Putting the sources in a executable jar just makes it bigger and slower to
> load at run--time with absolutely no benefit to the execution.
>
> Wayne is right that it will not break anything but why do it.

Actually that is the scary thing... it CAN break things. Go read that
old Maven Users email from early 2010 that I linked to.

This is definitely an anti-pattern IMO.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven compile error message format

Posted by Ron Wheeler <rw...@artifact-software.com>.
Putting the sources in a executable jar just makes it bigger and slower 
to load at run--time with absolutely no benefit to the execution.

Wayne is right that it will not break anything but why do it.

People who run programs are not generally the people who read or use 
source code.
People who want the source code are probably going to alter it to make a 
new executable jar with their version of your code.
They don't need your compiled classes in the source artifact that you 
give them.

Make it a separate artifact if you want to share the source code.

Ron


On 12/04/2012 10:39 AM, Wayne Fay wrote:
>> That is the reason for my two jars, one is source and the other binary.
>> However, this statement does not make sense in all cases, since one can
>> create self-running JAR files with mainclass.mf manifest file to run the
>> program with "java -jar myProgram.jar". This may include both binary and
>> source.
> In and of itself, this is a true statement. It does not mean that it
> is a best practice. I'm sure that we could come up with all kinds of
> things that "work" but are probably a bad idea for one reason or
> another.
>
> Read this thread (4 messages from late 2010) for more info:
> http://mail-archives.apache.org/mod_mbox/maven-users/201001.mbox/%3C27135933.post@talk.nabble.com%3E
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: maven compile error message format

Posted by Wayne Fay <wa...@gmail.com>.
> That is the reason for my two jars, one is source and the other binary.
> However, this statement does not make sense in all cases, since one can
> create self-running JAR files with mainclass.mf manifest file to run the
> program with "java -jar myProgram.jar". This may include both binary and
> source.

In and of itself, this is a true statement. It does not mean that it
is a best practice. I'm sure that we could come up with all kinds of
things that "work" but are probably a bad idea for one reason or
another.

Read this thread (4 messages from late 2010) for more info:
http://mail-archives.apache.org/mod_mbox/maven-users/201001.mbox/%3C27135933.post@talk.nabble.com%3E

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven compile error message format

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, Apr 12, 2012 at 2:55 PM, mike digioia <mp...@gmail.com> wrote:
> Thanks Wayne,
>
> That is the reason for my two jars, one is source and the other binary.
> However, this statement does not make sense in all cases, since one can
> create self-running JAR files with mainclass.mf manifest file to run the
> program with "java -jar myProgram.jar". This may include both binary and
> source.

http://stackoverflow.com/questions/2253077/what-are-the-maven-2-best-practices
"Don't fight against Maven, you'll loose."

Maven offers you "best practices", if you decide not follow them that
is your choice, but it is much easier if you accept Maven's view of
the world.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven compile error message format

Posted by mike digioia <mp...@gmail.com>.
Thanks Wayne,

That is the reason for my two jars, one is source and the other binary.
However, this statement does not make sense in all cases, since one can
create self-running JAR files with mainclass.mf manifest file to run the
program with "java -jar myProgram.jar". This may include both binary and
source.



On Wed, Apr 11, 2012 at 7:30 PM, Wayne Fay <wa...@gmail.com> wrote:

> > 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
>
> You have already been sufficiently razed over the real issue regarding
> your import statements. I won't pile on but assume that you will
> review your Java 101 documentation.
>
> I do want to point out (for you and anyone else who sees this thread
> in the future) that it is highly unlikely that you want to use the
> same jar for "sources" and binary. This is what your install-file
> command above is doing.
>
> In general, I'd expect to see a binary jar (eg jmdns.jar) and a
> sources jar (eg jmdns-src.jar). You would specify the binary file with
> -Dfile and the source file with -Dsources.
>
> In fact, I'd go so far as to strongly encourage you to NOT use a
> sources jar (or a binary jar that packs the sources along with the
> compiled binaries) as if it was a binary jar. Compilers will do funky
> things when they run into Java source code in binary jars -- we've
> seen several complaints from people doing GWT work on this list where
> their compilers were giving odd error messages that were related to
> the source files in their binary jars.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: maven compile error message format

Posted by Wayne Fay <wa...@gmail.com>.
> 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

You have already been sufficiently razed over the real issue regarding
your import statements. I won't pile on but assume that you will
review your Java 101 documentation.

I do want to point out (for you and anyone else who sees this thread
in the future) that it is highly unlikely that you want to use the
same jar for "sources" and binary. This is what your install-file
command above is doing.

In general, I'd expect to see a binary jar (eg jmdns.jar) and a
sources jar (eg jmdns-src.jar). You would specify the binary file with
-Dfile and the source file with -Dsources.

In fact, I'd go so far as to strongly encourage you to NOT use a
sources jar (or a binary jar that packs the sources along with the
compiled binaries) as if it was a binary jar. Compilers will do funky
things when they run into Java source code in binary jars -- we've
seen several complaints from people doing GWT work on this list where
their compilers were giving odd error messages that were related to
the source files in their binary jars.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven compile error message format

Posted by Ron Wheeler <rw...@artifact-software.com>.
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<ba...@gmail.com>  wrote:
>
>> On Wed, Apr 11, 2012 at 4:45 PM, mike digioia<mp...@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-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: maven compile error message format

Posted by Stephen Connolly <st...@gmail.com>.
Oh we all know what the issue is.

Hint: You don't know what a valid package name is and you don't understand
some basic concepts of Java.

Trust us, this *is* a java programming issue. This is *not* a maven issue.

On 12 April 2012 00:42, mike digioia <mp...@gmail.com> wrote:

> Thanks
>
> I see you don't know what the issue is either. This is not a java
> programming issue. It is a maven issue. I have been living with the maven
> manual for a week. But that has not been much time considering what they
> built.
>
> On Wed, Apr 11, 2012 at 4:25 PM, Barrie Treloar <ba...@gmail.com>
> wrote:
>
> > On Thu, Apr 12, 2012 at 8:22 AM, mike digioia <mp...@gmail.com> 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
> > [del]
> > > [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
> > [del]
> > > 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>
> >
> > [del]
> >
> > > package com.huawei.cona.android.zeroconf;
> > >
> > > import java.io.IOException;
> > >
> > > import jmdns-new;
> > > import service-new;
> > [del]
> >
> > I'm sorry, the short and blunt answer is you need to go on a Java course.
> > Start with http://docs.oracle.com/javase/tutorial
> > Plus other replies have also provided other links you might find useful.
> >
> > You are misunderstanding the fundamentals of programming in Java and
> > mixing up java archives (*.jar files) with java packages (the stuff
> > you import).
> > There is just way to much knowledge missing for people on this list to
> > help you out.
> >
> > Once you have a solid foundation in Java, I recommend you read the
> > freely available books on Maven at
> > http://maven.apache.org/articles.html
> > This will help you understand what are good values for <version>, what
> > is the purpose of <scope>, why should avoid the use of
> > <scope>system</scope>.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: maven compile error message format

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, Apr 12, 2012 at 9:12 AM, mike digioia <mp...@gmail.com> wrote:
> Thanks
>
> I see you don't know what the issue is either. This is not a java
> programming issue. It is a maven issue. I have been living with the maven
> manual for a week. But that has not been much time considering what they
> built.

[del]

As others have pointed out your problem is here:
>> > import jmdns-new;
>> > import service-new;

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven compile error message format

Posted by mike digioia <mp...@gmail.com>.
Thanks

I see you don't know what the issue is either. This is not a java
programming issue. It is a maven issue. I have been living with the maven
manual for a week. But that has not been much time considering what they
built.

On Wed, Apr 11, 2012 at 4:25 PM, Barrie Treloar <ba...@gmail.com> wrote:

> On Thu, Apr 12, 2012 at 8:22 AM, mike digioia <mp...@gmail.com> 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
> [del]
> > [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
> [del]
> > 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>
>
> [del]
>
> > package com.huawei.cona.android.zeroconf;
> >
> > import java.io.IOException;
> >
> > import jmdns-new;
> > import service-new;
> [del]
>
> I'm sorry, the short and blunt answer is you need to go on a Java course.
> Start with http://docs.oracle.com/javase/tutorial
> Plus other replies have also provided other links you might find useful.
>
> You are misunderstanding the fundamentals of programming in Java and
> mixing up java archives (*.jar files) with java packages (the stuff
> you import).
> There is just way to much knowledge missing for people on this list to
> help you out.
>
> Once you have a solid foundation in Java, I recommend you read the
> freely available books on Maven at
> http://maven.apache.org/articles.html
> This will help you understand what are good values for <version>, what
> is the purpose of <scope>, why should avoid the use of
> <scope>system</scope>.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: maven compile error message format

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, Apr 12, 2012 at 8:22 AM, mike digioia <mp...@gmail.com> 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
[del]
> [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
[del]
> 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>

[del]

> package com.huawei.cona.android.zeroconf;
>
> import java.io.IOException;
>
> import jmdns-new;
> import service-new;
[del]

I'm sorry, the short and blunt answer is you need to go on a Java course.
Start with http://docs.oracle.com/javase/tutorial
Plus other replies have also provided other links you might find useful.

You are misunderstanding the fundamentals of programming in Java and
mixing up java archives (*.jar files) with java packages (the stuff
you import).
There is just way to much knowledge missing for people on this list to
help you out.

Once you have a solid foundation in Java, I recommend you read the
freely available books on Maven at
http://maven.apache.org/articles.html
This will help you understand what are good values for <version>, what
is the purpose of <scope>, why should avoid the use of
<scope>system</scope>.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven compile error message format

Posted by mike digioia <mp...@gmail.com>.
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 <ba...@gmail.com> wrote:

> On Wed, Apr 11, 2012 at 4:45 PM, mike digioia <mp...@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-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Re: Re: maven compile error message format

Posted by Thorsten Heit <th...@vkb.de>.
Hi,

> > ok thnak you very much. This was what I was expecting, however i could 

> not
> > see what the issue was. Here are the lines in the code from line 1 on
> > 
> > package com.huawei.cona.android.zeroconf;
> > 
> > import java.io.IOException;
> > 
> > import jmdns-1.0;
> > import service-1.0;
> 
> (...)
> 
> Quite easy: These package names are invalid. See for example here:
> http://java.about.com/od/i/g/identifier.htm

Or better:
http://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#isJavaIdentifierStart%28int%29
http://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#isJavaIdentifierPart%28int%29


HTH

Thorsten

Re: Re: maven compile error message format

Posted by Thorsten Heit <th...@vkb.de>.
Hi,

> ok thnak you very much. This was what I was expecting, however i could 
not
> see what the issue was. Here are the lines in the code from line 1 on
> 
> package com.huawei.cona.android.zeroconf;
> 
> import java.io.IOException;
> 
> import jmdns-1.0;
> import service-1.0;

(...)

Quite easy: These package names are invalid. See for example here:
http://java.about.com/od/i/g/identifier.htm


HTH

Thorsten

Re: maven compile error message format

Posted by mike digioia <mp...@gmail.com>.
ok thnak you very much. This was what I was expecting, however i could not
see what the issue was. Here are the lines in the code from line 1 on

package com.huawei.cona.android.zeroconf;

import java.io.IOException;

import jmdns-1.0;
import service-1.0;

import service.ServiceEvent;
import service.ServiceInfo;
import service.ServiceListener;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class ServiceDiscovery extends Activity {


any ideas? My pom has these exact files names in them as dependency

On Wed, Apr 11, 2012 at 12:28 AM, Barrie Treloar <ba...@gmail.com> wrote:

> On Wed, Apr 11, 2012 at 4:45 PM, mike digioia <mp...@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-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: maven compile error message format

Posted by Barrie Treloar <ba...@gmail.com>.
On Wed, Apr 11, 2012 at 4:45 PM, mike digioia <mp...@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-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven compile error message format

Posted by Shu <be...@gmail.com>.
Line 5 column 12

On Wednesday, April 11, 2012 9:15:24 AM UTC+2, mpd 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
>
> /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
>
>