mvn plugin doesn't seem to handle namespace -> package mappings #111

Closed
hedefalk opened this Issue Nov 8, 2011 · 6 comments

Projects

None yet

2 participants

@hedefalk
hedefalk commented Nov 8, 2011

Discussed here: https://groups.google.com/forum/#!topic/scalaxb/IDLuLFIwftc

I think we need something else than a Map[String, String] for the mappings, like a separate property class maybe? But I may be wrong since I'm no mvn guru ;) I posted a question here:

http://stackoverflow.com/questions/8045598/escape-strings-in-maven-map

Maybe some wisdom will come out of it.

Also, the cli call of these parameters seems broken:

Error: Unknown argument '-pActivitiesCreatedOrUpdated=dfk.ka.generated.crm.activities'
Error: Unknown argument '-pApplitacionsCreatedOrUpdated=dfk.ka.generated.crm.activities'

Here I just tried "ActivitiesCreatedOrUpdated" as targetNamespace, but there should be a colon there, right?

Thanks,
Viktor

@martiell martiell was assigned Nov 8, 2011
@martiell
Collaborator
martiell commented Nov 8, 2011

I think it could use java.util.Properties instead of Map, which'd be specified as:

<myProperties>
  <property>
    <name>propertyName1</name>
    <value>propertyValue1</value>
  <property>
</myProperties>

http://maven.apache.org/guides/plugin/guide-java-plugin-development.html

@hedefalk
hedefalk commented Nov 8, 2011

Excellent, that sounds right :)

@hedefalk
hedefalk commented Nov 8, 2011

Or maybe the version suggested here is more maven standard to make the semantics mor obvious?

http://stackoverflow.com/questions/8045598/escape-strings-in-maven-map/8049921#8049921

@martiell
Collaborator
martiell commented Nov 8, 2011

Yeah, that would work. I can't remember whether the key/value element names are mandated when using properties, or whether it's just the structure that counts.

If using Properties does require the elements to be 'name' and 'value' I'll use an object instead.

@martiell martiell added a commit to martiell/scalaxb that referenced this issue Nov 10, 2011
@martiell martiell mvn-scalaxb: Change packageNames parameter from a map to object array. (
#111)

The packageNames parameter was a Map<String, String>. This commit adds
a PackageName class, and changes the parameter to type PackageName[].
This is necessary because the URIs that need to be mapped are not
valid XML element names, and hence could not be specified as keys
when the parameter was a map.

This also adds maven-plugin-testing-harness, to allow unit tests to be
written for the mojo, in addition to the existing integration tests.
e862776
@martiell
Collaborator

Fixed in snapshot 0.6.6-20111110.214735-4.

@martiell martiell closed this Nov 10, 2011
@hedefalk

Thanks a lot! Will try it out!

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