Modify

Opened 3 months ago

Closed 3 months ago

Last modified 7 weeks ago

#18880 closed task (fixed)

Fix Netbeans configuration and update/improve Developers Guide Compiling using Netbeans

Reported by: Klumbumbus Owned by: team
Priority: normal Milestone: 20.03
Component: Core Version:
Keywords: netbeans ivy Cc: bastiK

Description (last modified by Klumbumbus)

So far I compiled only with ant. To check out the advantages of an IDE I choose Netbeans and followed wiki:/DevelopersGuide/Compiling#CompilingusingNetbeans
It is outdated after r16006. Changing subdirectory netbeans/ to subdirectory ide/netbeans/ and updating the screenshot is no big deal.
edit: fixed
However there are the following problems:

After opening the netbeans project it did not find several jar files and folders. I selected the files manually however the folders test-unit, test-performance, test-functional and core-src are not available.


edit: fixed

Compiling does not work:
C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\nbbuild.xml:15: Cannot find C:\Users\stefa\Documents\OSM\josm\core\ide\build.xml imported from C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\nbbuild.xml

It seems it tries to find the josm build.xml in /ide, not in the root. Regression of r16006 or which additional steps are required for compiling?

edit: fixed, but new error, see comment:5

Attachments (2)

netbeans2.png (29.9 KB) - added by Klumbumbus 3 months ago.
netbeans3.png (8.5 KB) - added by Klumbumbus 3 months ago.

Download all attachments as: .zip

Change History (24)

Changed 3 months ago by Klumbumbus

Attachment: netbeans2.png added

comment:1 Changed 3 months ago by Don-vip

Keywords: netbeans added

comment:2 Changed 3 months ago by Don-vip

Milestone: 20.03

comment:3 Changed 3 months ago by Don-vip

In 16064/josm:

see #18845 - see #18880 - update Netbeans files

comment:4 Changed 3 months ago by Don-vip

Can you please try again?

comment:5 Changed 3 months ago by Klumbumbus

It's not yet working.

ant -f C:\\Users\\stefa\\Documents\\OSM\\josm\\core\\ide\\netbeans\\nbbuild.xml -Dnb.internal.action.name=rebuild clean jar
init:
deps-clean:
Created dir: C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\build
Updating property file: C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\build\built-clean.properties
Deleting directory C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\build
clean:
init:
deps-jar:
Created dir: C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\build
Updating property file: C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\build\built-jar.properties
Created dir: C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\build\classes
set-josmbase-properties:
init-ivy:
resolve:
:: loading settings :: url = jar:file:/C:/Users/stefa/.ant/lib/ivy.jar!/org/apache/ivy/core/settings/ivysettings.xml
C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\ivy.xml (Das System kann die angegebene Datei nicht finden) in file:/C:/Users/stefa/Documents/OSM/josm/core/ide/netbeans/ivy.xml
C:\Users\stefa\Documents\OSM\josm\core\build.xml:1098: syntax errors in ivy file: 
java.text.ParseException: C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\ivy.xml (Das System kann die angegebene Datei nicht finden) in file:/C:/Users/stefa/Documents/OSM/josm/core/ide/netbeans/ivy.xml
	at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:293)
	at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:123)
	at org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:50)
	at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:198)
	at org.apache.ivy.Ivy.resolve(Ivy.java:507)
	at org.apache.ivy.ant.IvyResolve.doExecute(IvyResolve.java:328)
	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:259)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
	at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
	at org.apache.tools.ant.Task.perform(Task.java:350)
	at org.apache.tools.ant.Target.execute(Target.java:449)
	at org.apache.tools.ant.Target.performTasks(Target.java:470)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
	at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
Caused by: java.io.FileNotFoundException: C:\Users\stefa\Documents\OSM\josm\core\ide\netbeans\ivy.xml (Das System kann die angegebene Datei nicht finden)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:93)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
	at org.apache.ivy.util.url.BasicURLHandler.openStream(BasicURLHandler.java:211)
	at org.apache.ivy.util.url.URLHandlerDispatcher.openStream(URLHandlerDispatcher.java:137)
	at org.apache.ivy.util.url.URLHandlerDispatcher.openStream(URLHandlerDispatcher.java:129)
	at org.apache.ivy.util.XMLHelper.parse(XMLHelper.java:122)
	at org.apache.ivy.util.XMLHelper.parse(XMLHelper.java:116)
	at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:272)
	... 21 more
BUILD FAILED (total time: 0 seconds)

comment:6 Changed 3 months ago by Klumbumbus

Also it seems not right to me that I can't access the josm folder structure in the "Files" window (similar to the example project Anagram Game). Instead the structure starts with the sub sub folder ide\netbeans.


I cleared the Netbeans cache to hopefully get gid of any local changes made before r16064.

Another problem is that the file ide\netbeans\nbproject\project.properties gets modified. I don't think that should be the case.

  • project.properties

     
    2121#debug.transport=dt_socket
    2222debug.classpath=\
    2323    ${run.classpath}
     24debug.modulepath=\
     25    ${run.modulepath}
    2426debug.test.classpath=\
    2527    ${run.test.classpath}
     28debug.test.modulepath=\
     29    ${run.test.modulepath}
    2630# Files in build.classes.dir which should be excluded from distribution jar
    2731dist.archive.excludes=
    2832# This directory is removed when the project is cleaned:
     
    5559javac.compilerargs=-Xlint:unchecked -Xlint:cast -Xlint:dep-ann -Xlint:divzero -Xlint:empty -Xlint:finally -Xlint:overrides -Xlint:static -Xlint:try  -Xlint:deprecation
    5660javac.deprecation=true
    5761javac.external.vm=false
     62javac.modulepath=
     63javac.processormodulepath=
    5864javac.processorpath=\
    5965    ${javac.classpath}
    6066javac.source=1.8
     
    7581    ${file.reference.awaitility-3.1.5.jar}:\
    7682    ${file.reference.spotbugs.jar}:\
    7783    ${file.reference.commons-testing-2.1.0.jar}
     84javac.test.modulepath=\
     85    ${javac.modulepath}
    7886javac.test.processorpath=\
    7987    ${javac.test.classpath}
    8088javadoc.additionalparam=
     
    96104run.classpath=\
    97105    ${javac.classpath}:\
    98106    ${build.classes.dir}
     107run.modulepath=\
     108    ${javac.modulepath}
    99109run.test.classpath=\
    100110    ${javac.test.classpath}:\
    101111    ${build.test.classes.dir}
     112run.test.modulepath=\
     113    ${javac.test.modulepath}
    102114source.encoding=UTF-8
    103115src.dir=${file.reference.core-src}
    104116test.functional.dir=${file.reference.test-functional}

(As said I'm a IDE newbie, so if I'm talking bullshit, please interfere.)

Changed 3 months ago by Klumbumbus

Attachment: netbeans3.png added

comment:7 Changed 3 months ago by Don-vip

I don't use Netbeans, only bastiK did. I guess new versions of Netbeans have additional properties, so feel free to commit the changes created by Netbeans.

comment:8 Changed 3 months ago by Don-vip

In 16087/josm:

see #18880 - update netbeans work dir

comment:9 Changed 3 months ago by Don-vip

Please try again with r16087+

comment:10 Changed 3 months ago by Klumbumbus

In 16095/josm:

see #18880 - fix one netbeans file reference

comment:11 in reply to:  9 Changed 3 months ago by Klumbumbus

Replying to Don-vip:

Please try again with r16087+

I didn't notice a difference, I get still the same error.

comment:12 Changed 3 months ago by Klumbumbus

Cc: bastiK added

@bastiK: could you please have a look at the netbeans configuration?

comment:13 Changed 3 months ago by Klumbumbus

Description: modified (diff)
Summary: update/improve Developers Guide Compiling using NetbeansFix Netbeans configuration and update/improve Developers Guide Compiling using Netbeans

comment:14 Changed 3 months ago by Klumbumbus

Component: Wiki contentCore

comment:15 Changed 3 months ago by Don-vip

Keywords: ivy added

comment:16 Changed 3 months ago by Don-vip

In 16125/josm:

see #16860 - see #18880 - explicit use of Ivy configuration files for Netbeans compatibility

comment:17 Changed 3 months ago by Don-vip

Now Ivy runs fine with Netbeans. We need to update javac.classpath with the contents of runtime.path, as described on Netbeans wiki

Last edited 3 months ago by Don-vip (previous) (diff)

comment:18 Changed 3 months ago by Don-vip

In 16139/josm:

see #16860 - see #18880 - setup Ivy in Netbeans project

comment:19 Changed 3 months ago by Don-vip

Resolution: fixed
Status: newclosed

I managed to build and run JOSM with the above change.

Note that the build needs to be run twice!

The first build will write ivy.classpath in project.properties, second build will read it. I couldn't find a better way.

Last edited 3 months ago by Don-vip (previous) (diff)

comment:20 Changed 3 months ago by Klumbumbus

Thanks. Works for me now too.

comment:21 Changed 2 months ago by Klumbumbus

In 16219/josm:

see #16860, see #18880 - Adapt Netbeans config to r16165

comment:22 Changed 7 weeks ago by Klumbumbus

r16229 broke the project.properties file again as it still references the jar files.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.